unmount的表单项也会被校验,该如何避免呢? #1678
Answered
by
janryWang
specialCoder
asked this question in
Q&A [2.x]
-
根据输入的数字N动态生成N个表单项,当N改为M后UI上显示M个(N>M),但是实际校验的是N个表单项。如何才能不校验unmount的表单项目?更理想的,能否处理掉unmount的数据? |
Beta Was this translation helpful? Give feedback.
Answered by
janryWang
Jun 29, 2021
Replies: 3 comments 9 replies
-
unmount本来就不会校验表单,还有提问要带demo的,让维护者帮你yy问题场景是啥意思 |
Beta Was this translation helpful? Give feedback.
4 replies
This comment was marked as spam.
This comment was marked as spam.
-
因为你不用ArrayField,所以你需要自己手动清除form.fields里的字段,自己在数字改变的时候清空不要的字段模型吧。 |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
janryWang
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
因为你不用ArrayField,所以你需要自己手动清除form.fields里的字段,自己在数字改变的时候清空不要的字段模型吧。
还有你这种写法,全是反模式,observable在渲染函数里调用,为啥不用useMemo缓存,observer为啥要在渲染函数里执行