校验
confirmPwd: [
{
required: true,
validator: (rule, value, callback) => {
if (this.ruleForm.confirmPwd === '') {
callback(new Error('请再次输入密码'))
} else if (this.ruleForm.confirmPwd != this.ruleForm.pwd) {
callback(new Error('两次输入密码不一致!'))
} else {
callback()
}
},
trigger: 'blur'
}
],
回显
this.$set(this.ruleForm,'confirmPwd',data.pwd)//vue监听不到form表单变化 所以需要set