<el-form ref="loginForm" :model="user" :rules="loginRules" size="large"></el-form>
changeType(){
this.type = this.type == 2?1:2;
this.clearVail();
// this.user.name = '';
// this.user.password = '';
},
//清除验证
clearVail(){
this.$refs['loginForm'].clearValidate();
},
本文探讨了在Element UI框架中如何实现表单类型动态切换,并在切换时清除原有表单验证,确保用户体验流畅。通过修改表单类型并调用clearValidate方法,可以有效地重置表单状态。
986

被折叠的 条评论
为什么被折叠?



