docs: 补充 tabs 作为表单项值的示例 (#5618)

This commit is contained in:
吴多益 2022-10-24 16:57:16 +08:00 committed by GitHub
parent 99306591ec
commit db33ac8df0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -175,6 +175,60 @@ order: 68
}
```
## 作为表单项的值
如果在表单里给 tabs 配置了 name它可以作为一个表单提交项的值默认情况下会取 title
```schema: scope="body"
{
"type": "form",
"debug": true,
"body": [
{
"type": "tabs",
"name": "tab",
"tabs": [
{
"title": "Tab 1",
"tab": "Content 1"
},
{
"title": "Tab 2",
"tab": "Content 2"
}
]
}
]
}
```
如果不想使用 title可以给每个 tab 设置 value这样就会取这个 value 作为表单项的值
```schema: scope="body"
{
"type": "form",
"debug": true,
"body": [
{
"type": "tabs",
"name": "tab",
"tabs": [
{
"title": "Tab 1",
"tab": "Content 1",
"value": 0
},
{
"title": "Tab 2",
"tab": "Content 2",
"value": 1
}
]
}
]
}
```
## 展示模式
### 简约