Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

form-create 嵌套form-create,外层的form-create的submit会导致嵌套的form-create校验触发。 #638

Open
bigbangfather opened this issue Sep 27, 2023 · 3 comments
Labels
一个优化 优化一下

Comments

@bigbangfather
Copy link

form-create rule中使用了自定义的组件,自定义的组件也是一个form-create,但是当外部的form-create提交时候会触发自定义组件内的form-create校验,我认为这是一个奇怪的行为,导致我无法主动控制自定义组件内form-create的行为

期望可以解决嵌套时校验的触发方式。

@xaboy
Copy link
Owner

xaboy commented Sep 28, 2023

父表单校验时,自动校验子表单,这个是正常逻辑吧. 什么场景下不需要校验子表单呢? @bigbangfather

@bigbangfather
Copy link
Author

父表单校验时,自动校验子表单,这个是正常逻辑吧. 什么场景下不需要校验子表单呢? @bigbangfather

一个自定义组件是由基于form-create实现的,这个组件是应用在外层的form-create上,外层通过类型去控制此组件的渲染,当我切换类型的时候我希望保持录入的数据不被清空所以用了display控制显隐而没有使用hidden,但当我隐藏的时候,提交还是会触发组件内的校验,所以我期望能在使用display的时候不会触发隐藏组件内的form-create校验。

@xaboy xaboy added the 一个优化 优化一下 label Oct 18, 2023
@xaboy
Copy link
Owner

xaboy commented Nov 1, 2023

这边测试hidden不会导致录入的数据被清空, 请问这个问题怎么复现 @bigbangfather

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
一个优化 优化一下
Projects
None yet
Development

No branches or pull requests

2 participants