电话字段
电话字段
The tel field stores a telephone number inside a repeater row.
最适合
- 办公地点
- 支持联系方式区块
- 销售代表
- 重复的分支列表
架构示例
{ "name": "phoneNumber", "label": "Phone", "type": "tel" }模板用法
{{#each offices as="item"}}
<a href="tel:{{ item.phoneNumber }}">{{ item.phoneNumber }}</a>
{{/each}}办公室卡片示例:
{{#each offices as="item"}}
<div class="office-card">
<h3>{{ item.city }}</h3>
<a href="tel:{{ item.phoneNumber }}">{{ item.phoneNumber }}</a>
</div>
{{/each}}何时使用
当字段应明确表示可拨打的号码而不是通用文本时,使用 tel。
何时不应使用
在以下情况下不要使用 tel:
- 值不是真实的电话号码
- 该号码应作为共享的 Variable 全局共享,而不是存储在每一行中
改用 text 或共享的 Variable。
技术说明
- 仅对实际可拨打的号码使用
tel - 与
text配合使用以表示办公室名称、标签或说明性上下文 - 如果相同电话号码被广泛重复使用,请集中管理,而不是逐行重复存储
- 不要在同一字段中混合分机、标签和解释性文本,除非输出契约确实需要一个原始的单一值