0👍
Return the promise from your validate function – then vee-validate will wait until it completes before doing anything further. I couldn’t find any reference for this, but I think it should work.
extend('exists', value => {
return apiService.checkUsername(value)
.then(response =>
response.data[0].username == value?true:false;
)
.catch(response => alert(response.message));
})
- [Vuejs]-How to initialize a data property to a prop object property in Vue JS
- [Vuejs]-How to switch vue.js router views without rerendering html
Source:stackexchange.com