[Vuejs]-Why doesn't let me access to the other javascript functions Vue Laravel

0👍

You’re defaulting this.errors to be a new Errors instance, but then you’re overwriting this instance in your axios callback. this.errors = err.response.data.errors || {} is overwriting your Errors instance, not updating it.

You’ll want to use the record() method on your Errors instance to update your Errors instance with the set of errors that came back from the request.

if (err.response.status === 422) {
    this.errors.record(err.response.data.errors || {})
    console.log(this.errors.get('linkedin'))
}

Leave a comment