Hello,
I have add v-validate="'required'" in input tag <input> and <multiselect> and <datepicker>.
https://github.com/monterail/vue-multiselect
https://github.com/charliekassel/vuejs-datepicker
This require validation works well with <input> tag after we blur it without fill data.
But this require validation doesn't work with <multiselect> and <datepicker> after I blur them without choose data.
How can I make it works like <input>?
Thanks.
unless these component emit the blur event, you cannot validate them on blur. However there are alternative events that might give you the same behavior using data-vv-validate-on attribute to override the default events.
For the multiselect it emits close event when the dropdown is closed which is also when the user leaves the control.
<multiselect data-vv-validate-on="input|close" ...>
For the date-picker you can instead validate on closed since that event emits when the user leaves the control.
<datepicker data-vv-validate-on="input|closed" ...>
Most helpful comment
unless these component emit the
blurevent, you cannot validate them on blur. However there are alternative events that might give you the same behavior usingdata-vv-validate-onattribute to override the default events.For the
multiselectit emitscloseevent when the dropdown is closed which is also when the user leaves the control.For the date-picker you can instead validate on
closedsince that event emits when the user leaves the control.