elementui el-cascader表单校验不生效



 



data(){
  const validateOrg = (rule, value, callback) => { 
      if (!this.form.organizationList.length) {
        callback(new Error('组织不能为空'))
      } else {
        callback()
      }
    }
  return {
    rules:{
     organizationList: [{ type: 'array', required: true, validator: validateOrg }],
    }
  }
}

你可能感兴趣的:(elementui el-cascader表单校验不生效)