Skip to content

Commit

Permalink
增加each文档
Browse files Browse the repository at this point in the history
  • Loading branch information
catchonme committed Aug 20, 2019
1 parent cb3b422 commit 19755b7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/renderers.md
Expand Up @@ -40,7 +40,7 @@ amis 页面是通过 JSON 配置出来的,是由一个一个渲染模型组成
- [Date-Range](./renderers/Form/Date-Range.md): 日期范围类型
- [Color](./renderers/Form/Color.md): 颜色选择器
- [Range](./renderers/Form/Range.md): 范围输入框
- [Image](./renderers/Form/Image.md): 图片格式输
- [Image](./renderers/Form/Image.md): 图片输入
- [File](./renderers/Form/File.md): 文件输入
- [Matrix](./renderers/Form/Matrix.md): 矩阵类型的输入框
- [Tree](./renderers/Form/Tree.md): 树形结构输入框
Expand Down
19 changes: 19 additions & 0 deletions docs/renderers/Each.md
@@ -0,0 +1,19 @@
## Each

基于现有变量循环输出渲染器

- `type` 请设置 `each`
- `value` 格式为数组。
- `items` 使用`value`中的数据,循环输出渲染器。


```schema:height="160" scope="body"
{
"type": "each",
"value": ["A", "B", "C"],
"items": {
"type": "tpl",
"tpl": "<span class='label label-default'><%= data.item %></span> "
}
}
```
7 changes: 7 additions & 0 deletions examples/components/Doc.jsx
Expand Up @@ -436,6 +436,13 @@ export default {
cb(null, makeMarkdownRenderer(doc));
}),
},
{
label: 'Each',
path: '/docs/renderers/Each',
getComponent: (location, cb) => require(['../../docs/renderers/Each.md'], (doc) => {
cb(null, makeMarkdownRenderer(doc));
}),
},
{
label: 'Tpl',
path: '/docs/renderers/Tpl',
Expand Down

0 comments on commit 19755b7

Please sign in to comment.