Solve the problem of form validation when element el-form opens the modal box

If written in front
In projects, some form verification is often required to verify whether field names exist, such as special character verification when setting passwords, etc.

Problem Description
Recently I encountered a strange problem. When the modification modal box was opened without any modifications, a verification was automatically triggered, prompting that the user name already exists or Just after opening the new modal box without performing any operations, it was automatically verified, prompting that each field cannot be empty. Then jb test submitted an order
Insert image description here
Solution
I searched and searched carefully and looked at the Ele.me document and found that el-form has an attribute
Insert image description here
I will add it to the code

 <el-form :model="resetForm" ref="resetForm" :rules="resetRules" :validate-on-rule-change="false">

Then it was solved. Come on! ! ! ! Make money! ! ! ! !

I hope my problem record can help you!

Guess you like

Origin blog.csdn.net/weixin_44582045/article/details/123824776#comments_29934467