age: [
{required: true, message: '请输入年龄', trigger: 'blur'},
{
validator: (rule, value, callback) => {
if (value >= 18) {
callback();
} else {
callback(new Error("教练年龄必须大于18周岁"));
}
}, trigger: 'blur'
}
],
标签:Vue,自定义,校验,value,callback,trigger,blur From: https://www.cnblogs.com/dndt/p/17481662.html