解决:切换另个一个表单事件中或者打开模态框的事件中,用this.$nextTick(function(){})重新设置。
onReady() {
this.$refs.registerForm.setRules(this.registerRules);
},
methods:{
// 切换tab
cutTab(type){
this.activeIndex = type
if(type === 1){
this.$nextTick(function(){
this.$refs.firmRegisterForm.setRules(this.firmRegisterRules);
})
}else{
this.$nextTick(function(){
this.$refs.registerForm.setRules(this.registerRules);
})
}
},
}