简体   繁体   English

Ant Design 问题中的选项卡式表单

[英]Tabbed Form in Ant Design Issue

Tabbed Form doesn't seem possible in AntDesign.在 AntDesign 中,选项卡式表单似乎是不可能的。 all field error comes when we submit form inside tab当我们在选项卡内提交表单时,所有字段错误都会出现

在此处输入图像描述

Blockers阻滞剂

  1. On Submit only current active tab form values comes在提交时,只有当前活动的选项卡表单值才会出现
  2. Tabs are inside the form选项卡在表单内
  3. all field error Comes when we submit form inside tab当我们在选项卡内提交表单时出现所有字段错误
  4. destroyInactiveTabPane i try this but not working destroyInactiveTabPane 我尝试这个但不工作
  5. If i have to generate tabs dynamically like English, French, Italian, i cannot initialling Form as tab loop will come inside of component如果我必须像英语、法语、意大利语一样动态生成选项卡,我无法初始化表单,因为选项卡循环将进入组件内部
  6. Forced render of content in tabs, not lazy render after clicking on tabs i try this but not working强制呈现选项卡中的内容,而不是在单击选项卡后延迟呈现我尝试这个但不工作
  7. Error Validation Trigger when i submit form of all filed with in the form当我提交表单中所有提交的表单时,错误验证触发器

Create forms inside each tab and in your parent file which will hold the tabs data, active tab manage the state.在每个选项卡内和将保存选项卡数据的父文件中创建表单,活动选项卡管理状态。 Create form for each tab.为每个选项卡创建表单。 Suppose i have name and member tab i will create the form with Const nameForm = useForm() Const memberForm =useForm()假设我有名称和成员选项卡,我将使用 Const nameForm = useForm() Const memberForm =useForm() 创建表单

And pass each form as props to the component.并将每个表单作为道具传递给组件。 Nameform to name component and so on. Nameform 来命名组件等等。 And whenever you will try to change the tab or click submit check in function which tab is active and validate that form only.每当您尝试更改选项卡或单击提交检查功能时,哪个选项卡处于活动状态并仅验证该表单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM