janiskelemen / formvuelar

Vue form components with server-side validation in mind
https://janiskelemen.github.io/formvuelar/
MIT License
300 stars 25 forks source link

@error response #8

Closed ghost closed 4 years ago

ghost commented 5 years ago

Hey,

It should be changed in the file FvlForm.vue :

// from
$this.$emit('error', error)
// to
$this.$emit('error', error.response)

Otherwise we can not use the returned object on the component

<FvlForm @error="onError">
onError(error) {
   console.log(error.data)
  // from: undefined
 // to: Error Object
}

Look for the explanation https://github.com/axios/axios/issues/960#issuecomment-309287911

Having forked your code and modified it a bit I do not know if it's the same with formvuelar. Seem yes.

janiskelemen commented 4 years ago

Thank's I'll fix this.