pro-components icon indicating copy to clipboard operation
pro-components copied to clipboard

🧐[问题]StepsForm中的下一步按钮如何控制只校验当前StepForm部分必填字段

Open hesetiema opened this issue 1 year ago • 0 comments

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

🧐 问题描述

StepsForm中的下一步按钮当前默认是调用 props.onSubmit() 方法,但实际会校验当前 StepForm 全部必填字段,业务需要涉及在三四层嵌套的 Form.List 中仅校验部分选中项必填字段。

💻 示例代码

submitter={{ render: (props) => { if (props.step === 0) { return ( <Button type="primary" onClick={() => props.onSubmit?.()}> 去第二步 {'>'} </Button> ); } }}

🚑 其他信息

hesetiema avatar Mar 01 '24 06:03 hesetiema