V
V
VoRoN19992020-02-11 10:40:45
Vue.js
VoRoN1999, 2020-02-11 10:40:45

What is the correct way to receive data via axios?

Hello. I send axios request and do error handling.
If you output error.response.data.errors , then there will be a normal JSON array, but this.errorsAxois is an object.
How to make this.errorsAxios become an array?

.catch(error => {
  this.errorsAxios.push(error.response.data.errors);
  console.log(this.errorsAxios);
 }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2020-02-11
@VoRoN1999

How do you announce errorsAxois?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question