Skip to content

[Enhancement] allow to pass array to validateMode and reValidateMode #33

@hunterliu1003

Description

@hunterliu1003

Describe the feature

Allow to pass multiple modes to validateMode, for example:

const Comp = defineComponent({
      setup() {
        const { register } = useForm({
          initialValues: {
            name: '',
          },
          validateMode: ['blur', 'change', 'input'],
          validate,
          onSubmit: noop,
        });

        const { value, attrs } = register('name');

        return { value, attrs };
      },
      template: `
        <input v-model="value" v-bind="attrs">
      `,
    });

Allow to pass multiple modes to reValidateMode, for example:

const Comp = defineComponent({
      setup() {
        const { register } = useForm({
          initialValues: {
            name: '',
          },
          reValidateMode: ['blur', 'change', 'input'],
          validate,
          onSubmit: noop,
        });

        const { value, attrs } = register('name');

        return { value, attrs };
      },
      template: `
        <input v-model="value" v-bind="attrs">
      `,
    });

Additional information

  • Would you be willing to help implement this feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions