如何清空表单? #1569
Answered
by
janryWang
yunuo-tech
asked this question in
Q&A [2.x]
如何清空表单?
#1569
-
现在碰到一个情况:录入表单的时候 切换到其他页面后再切换回来,发现之前录入的信息还在,如何在离开当前页面后自动清空表单里的内容? 用了form.setValues({})和form.setInitialValues({})都不行 |
Beta Was this translation helpful? Give feedback.
Answered by
janryWang
Jun 11, 2021
Replies: 3 comments 5 replies
-
form.reset('*',{forceClear:true}) 或者form.setValues({},'overwrite') ,文档都写有,是文档写的有问题吗? |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
janryWang
-
1623466169064851.mp4 |
Beta Was this translation helpful? Give feedback.
2 replies
-
不要在全局createForm,正确的应该是在渲染函数内部使用useMemo创建form实例,它会随着页面切换动态回收
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
form.reset('*',{forceClear:true}) 或者form.setValues({},'overwrite') ,文档都写有,是文档写的有问题吗?