Axios Get Request Json

Posted on  by admin
Modified1 year, 3 months ago.

I'm trying to use axios to get data from my API and to display it on a datatable on vue.js.

Here is my code in TypeScript :. I already tried without the JSON.parse(), and with a beforeCreate() but my magasins variable doesn't exist.

Here is my JSON format:.


Do someone have any idea how to change my TypeScript file to display data on my table? Antoine KurkaAntoine Kurka. So the problem appears to be due to the type conversion of magasins. You need to change the type of it which it is empty slice. And ensure you do not use JSON.parse. 22 gold badges1818 silver badges3939 bronze badges. 3939 bronze badges.

The issue is on component creation time the data does not exist yet.

Axios GET request with async/await