Vee-validate: it's not work well on select

Created on 12 Jul 2018  路  2Comments  路  Source: logaretm/vee-validate

Versions

  • vee-validate: 2.1.0-beta.6
  • vue: 2.1.0-beta.6

Describe the bug
On use it with elementui select component,when i choose an option,it check failed on event blur

馃 needs reproduction

Most helpful comment

It's because the default validation event is input.

To change this behavior globally, you can set the events for validation like so

Vue.use(VeeValidate, {
   events: 'input|blur'
});

Or you can change the behavior per input element like so

<select ... data-vv-validate-on="blur">
  ...
</select>

You can also have a look into the docs.

All 2 comments

It's because the default validation event is input.

To change this behavior globally, you can set the events for validation like so

Vue.use(VeeValidate, {
   events: 'input|blur'
});

Or you can change the behavior per input element like so

<select ... data-vv-validate-on="blur">
  ...
</select>

You can also have a look into the docs.

If @nicokoenig answer did not fix the issue for you, feel free to create a live example on jsfiddle or codesandbox and I will take a look.

Was this page helpful?
0 / 5 - 0 ratings