去除form表单默认校验的这两个值
this.$nextTick( ()=> {
this.$refs['form'].clearValidate(['firstParty']);
this.$refs['form'].clearValidate(['secondParty']);
})
resetFields() 和 .clearValidate() 区别
this.$refs.form.resetFields(); //移除校验结果并重置字段值
this.$refs.form.clearValidate(); //移除校验结果
指定校验
// this.$refs.form表单的ref.validateField([单个item的prop名])
this.$refs.form.validateField(['num1'], (Error) => {
if (!Error) {
// 验证通过
console.log('通过了')
} else {
console.log('验证不通过')
}
})