重复字段
重复字段
The repeater field stores repeatable rows of structured content.
最佳适用场景
- 常见问题项
- 定价卡片
- 功能列表
- 时间线步骤
- 对比行
模式示例
{
"name": "faqItems",
"label": "FAQ Items",
"type": "repeater",
"fields": [
{ "name": "question", "type": "text" },
{ "name": "answer", "type": "textarea" }
]
}常用行子字段
在 repeater 内,团队常用:
texttextareanumberurlcheckboxcoloremailtelrange
这些子字段允许每个重复行同时包含内容和轻量级的项级设置。
模板用法
<div class="faq-list">
{{#each faqItems as="item"}}
<article class="faq-item">
<h3>{{ item.question }}</h3>
<p>{{ item.answer }}</p>
</article>
{{/each}}
</div>何时使用
当某个区域需要多个具有相同内部结构的条目时使用 repeater。
何时不使用
在以下情况下不要使用 repeater:
- 单个字段值就足够
- 行的结构并不相同
- 内容应该是动态列表,而不是本地重复行