Do not trigger a verification immediately after setting the rules attribute to change

Do not trigger a verification immediately after setting the rules attribute to change

Scenario: If two forms are entered through a switch, it is strange that the switch triggers the first validation if nothing is done.

Solution: Add: validate-on-rule-change="false" attribute

example:

<el-form :rules="rules" :validate-on-rule-change="false" ref="testForm" >

</el-form>

This way the checksum won't be triggered when switching! ! !

Little knowledge (clear prompt content): this.$refs.testForm.clearValidate();

testForm corresponds to the form name defined by itself each time

おすすめ

転載: blog.csdn.net/weixin_42947972/article/details/128000441