[Vuejs]-Async custom validator approves the field validation requirement while the promise is still resolving, how can I change the behaviour? Vuelidate

1👍

I think you should use loading value to keep field disabled when promise hasn’t been resolved yet. You can pass it as a prop to the component.

I also recommed to wrap loading.value = false with finally to be sure it’s always executed, even if there is an error thrown.

try {...}
catch (err) {
  console.log(err)
} finally {
  loading.value = false
}

Leave a comment