From fcebd81c55bfeae4eb64207af4e2b524e0ed3b10 Mon Sep 17 00:00:00 2001 From: wuduoyi Date: Wed, 20 Jul 2022 13:32:40 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E8=A1=A5=E5=85=85=20mapping=20?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E5=85=B6=E5=AE=83=20amis=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/zh-CN/components/mapping.md | 39 +++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/docs/zh-CN/components/mapping.md b/docs/zh-CN/components/mapping.md index 396eca79e..8fdb5c08c 100755 --- a/docs/zh-CN/components/mapping.md +++ b/docs/zh-CN/components/mapping.md @@ -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) |