Skip to content

[新功能需求] Form validate事件prop支持string[] #797

@yikoyu

Description

@yikoyu

这个功能解决了什么问题?

支持字符串数组以便校验部分表单

你期望的 API 是什么样子的?

const form = ref<FormInstance>()

function handleSubmit() {
  form
    .value!.validate(['validateField_1', 'validateField_2'])
    .then(({ valid, errors }) => {
      if (valid) {
        showSuccess({
          msg: '校验通过'
        })
      }
    })
    .catch((error) => {
      console.log(error, 'error')
    })
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions