data() { const validatePass = (rule, value, callback) => { if (value.length < 3) { callback(new Error("密码不能小于3位")); } else { callback(); } }; return { rules: { password: [ { required: true, trigger: "blur", validator: validatePass }, ] } }
data() { const validatePass = (rule, value, callback) => { if (value.length < 3) { callback(new Error("密码不能小于3位")); } else { callback(); } }; return { rules: { password: [ { required: true, trigger: "blur", validator: validatePass }, ] } }