Element UI version
2.13.0
OS/Browsers version
MacOs 10.13.6 / Chrome 79
Vue version
2.6.11
Reproduction Link
https://codepen.io/wgcg/pen/bGNLvPg
Steps to reproduce
- click the switch button
- click "立即创建"
What is Expected?
"活动形式"的规则进行校验 给予相应的错误提示
What is actually happening?
没有在活动形式的输入框输入内容 但是校验通过了
原因
复用了之前的FormItem实例,不会触发FormItem的mounted事件,也就不会push进form.fields中
临时解决方案
- 给”活动备注“的FormItem组件增加prop属性,这样在mounted时就会把该组件实例push进form.fields中,切换后复用了该组件,会更新它的prop属性,这样就能正常校验了
- 给"活动形式"的FormItem增加key属性,避免复用
2条答案
按热度按时间wlp8pajw1#
Translation of this issue:
Element UI version
2.13.0
OS/Browsers version
MacOs 10.13.6 / Chrome 79
Vue version
2.6.11
Reproduction Link
https://codepen.io/wgcg/pen/bGNLvPg
Steps to reproduce
What is Expected?
Check the rules of "activity form" and give corresponding error prompt
What is actually happening?
There is no input in the active input box, but the verification is passed
Reusing the previous formitem instance will not trigger the mounted event of formitem, nor push it into form.fields
Interim solutions
xmakbtuz2#
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.