From db33ac8df0b70dfe6268cadf3140bd773868c9e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=A4=9A=E7=9B=8A?= Date: Mon, 24 Oct 2022 16:57:16 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E8=A1=A5=E5=85=85=20tabs=20=E4=BD=9C?= =?UTF-8?q?=E4=B8=BA=E8=A1=A8=E5=8D=95=E9=A1=B9=E5=80=BC=E7=9A=84=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B=20(#5618)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/zh-CN/components/tabs.md | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/docs/zh-CN/components/tabs.md b/docs/zh-CN/components/tabs.md index 31ed648d2..f4c14d19d 100755 --- a/docs/zh-CN/components/tabs.md +++ b/docs/zh-CN/components/tabs.md @@ -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 + } + ] + } + ] +} +``` + ## 展示模式 ### 简约