iview表单验证之正则 正则验证: 代码: loginRules: { stringLength: [ { required: true, message: '该字段不能为空', trigger: 'blur' }, { pattern: /^[1-9]\d*$/, message: '该字段为整数', trigger: 'blur' } ] } 函数验证: 1.首先在data中定义验证方法 data () { const validateMax = (rule, value, callbac