iview表单校验

ruleValidate:{
// 自定义规则校验
 address: [
          {
            required: true,
            message: "请选择并输入经营地址",
            trigger: "blur",
            validator: () => {
              return (
                !!this.formValidate.choseAdd &&
                !!this.formValidate.address
              );
            }
          }
],
// 正则
email:[
         {
           type:'email',
           required: true,
           message: "请输入正确邮箱",
           trigger: "blur"
         },
         { pattern: /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/, message: '请输入正确邮箱地址', trigger: 'blur' }
]
}

你可能感兴趣的:(iview表单校验)