elementUI的rules表单自定义验证validator方法传递其他更多参数

一般写法,validateEmail能接收到三个参数:rule,value,callback

const rules = reactive({
  email: [{ validator: validateEmail, trigger: 'blur' }],
})

传递更多参数的写法

const rules = reactive({
  email: [
  	{
      validator: (rule, value, callback) => {
        validateEmail(rule, value, callback, xxx,xxx,xxx)
      },
      trigger: 'blur'
    }
  ],
})

你可能感兴趣的:(Element,elementui,vue.js,前端)