mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-15 09:21:13 +08:00
65ac422ed6
* 补充容错 * fix: form 中 name 关联顶层数据初始化失效 * 更新 examples * 文档调整 * 删除多余的文档, 调整 schema * schema 调整 * schema 调整 * control 类型容器 control 改成 body * 修复一个选项加载的bug * form 注册直接用 type
60 lines
1.2 KiB
Markdown
Executable File
60 lines
1.2 KiB
Markdown
Executable File
---
|
|
title: Tpl 模板
|
|
description:
|
|
type: 0
|
|
group: ⚙ 组件
|
|
menuName: Tpl
|
|
icon:
|
|
order: 70
|
|
---
|
|
|
|
输出 [模板](../../docs/concepts/template) 的常用组件
|
|
|
|
## 基本用法
|
|
|
|
```schema
|
|
{
|
|
"data": {
|
|
"text": "World!"
|
|
},
|
|
"type": "page",
|
|
"body": {
|
|
"type": "tpl",
|
|
"tpl": "Hello ${text}"
|
|
}
|
|
}
|
|
```
|
|
|
|
更多模板相关配置请看[模板文档](../../docs/concepts/template)
|
|
|
|
## 快速编辑
|
|
|
|
通过 `quickEdit` 开启快速编辑功能,比如
|
|
|
|
```schema: scope="body"
|
|
{
|
|
"type": "form",
|
|
"body": [
|
|
{
|
|
"name": "static",
|
|
"type": "static",
|
|
"label": "静态展示",
|
|
"value": "123",
|
|
"quickEdit": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
其他配置项参考 [快速编辑](crud#快速编辑)
|
|
|
|
## 属性表
|
|
|
|
| 属性名 | 类型 | 默认值 | 说明 |
|
|
| --------- | ------------------------------------ | ------- | --------------- |
|
|
| type | `string` | `"tpl"` | 指定为 Tpl 组件 |
|
|
| className | `string` | | 外层 Dom 的类名 |
|
|
| tpl | [模板](../../docs/concepts/template) | | 配置模板 |
|