vue确认密码

rules: {
pwd:[{
required:true, message:'创建密码',trigger:'blur'
}],
cpwd:[{
required:true,message:'确认密码',trigger:'blur'
},{
validator:(rule,value,callback)=>{
if(value===''){
callback(new Error('请再次输入密码'))
}else if(value!==this.ruleForm.pwd){
callback(new Error('两次输入密码不一致'))
}else{
callback( )
}
},
trigger:'blur'
}]
}
posted @ 2018-10-24 11:06  叶子玉  阅读(3783)  评论(0编辑  收藏  举报