iview Input 输入数字验证
验证规则中添加正则
{required: true, pattern: /^[a-z0-9]+$/, message: '请输入数字', trigger: 'change'}
//参考 async-validator
people: [
{ required: true, message: '请输入扫码解锁人数', trigger: 'blur' },
{ type: 'number', message: '请输入数字格式', trigger: 'blur', transform(value) {
return Number(value);
}}
],