I\'ve created a page where I want to get all my data from the database with an API call, but I\'m kinda new to VueJS and Javascript aswell and I don\'t know where I\'m getti
I got the same problem still stuck ...
Wrote these according to Evan(Vue Author) JSON.parse(JSON.stringify(res.data)) method, But why can't normal data?
methods: {
async getdata() {
console.log(1);
await axios.get(API).then((res) => {
console.log(2);
if (!this.dataList.length) {
this.dataList = JSON.parse(JSON.stringify(res.data));
console.log(3);
console.log(res.data, 'res.data ');
console.log(this.dataList, 'this.dataList')
console.log('----------check-----------',JSON.parse(JSON.stringify(res.data)));
}
})
.catch(err => {
console.error('failed: ' + err);
})
console.log(4);
},