Merge pull request #4924 from nwind/docs-mapping-schema

docs: 补充 mapping 渲染其它 amis 组件的示例
This commit is contained in:
RUNZE LU 2022-07-20 19:56:58 +08:00 committed by GitHub
commit 816966c33d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,6 +45,33 @@ order: 57
}
```
## 渲染其它组件
映射的值也可以是 amis schema渲染其它组件
```schema
{
"type": "page",
"body": {
"type": "mapping",
"value": "1",
"map": {
"1": {
"type": "tag",
"label": "#4096ff",
"displayMode": "rounded",
"color": "#4096ff"
},
"2": {
"type": "tpl",
"tpl": "2"
},
"*": "其他"
}
}
}
```
## 支持数组
> 1.5.0 及以上版本
@ -263,9 +290,9 @@ List 的内容、Card 卡片的内容配置同上
## 属性表
| 属性名 | 类型 | 默认值 | 说明 |
| ----------- | ----------------- | ------ | -------------------------------------------------------------------------------------- |
| className | `string` | | 外层 CSS 类名 |
| placeholder | `string` | | 占位文本 |
| map | `object` | | 映射配置 |
| source | `string` or `API` | | [API](../../../docs/types/api) 或 [数据映射](../../../docs/concepts/data-mapping) |
| 属性名 | 类型 | 默认值 | 说明 |
| ----------- | ----------------- | ------ | --------------------------------------------------------------------------------- |
| className | `string` | | 外层 CSS 类名 |
| placeholder | `string` | | 占位文本 |
| map | `object` | | 映射配置 |
| source | `string` or `API` | | [API](../../../docs/types/api) 或 [数据映射](../../../docs/concepts/data-mapping) |