0👍
I don’t know Laravel, but I think this is the problematic part:
this.items = data.data;
You need to place your data into items with a loop. Otherwise, the data in items is not reactive.
Like this (running a for loop, you also iterate with forEach):
this.items.splice(0); // just in case you want to replace already existing data
for (let i = 0, l = data.data.length; i < l; i++) {
this.items.push(data.data[i]);
}
I haven’t checked the code, but I think you get the idea;
- [Vuejs]-Passing the Properties of an Object to method in Vue.Js
- [Vuejs]-Vue: Ignore property until axios then
0👍
Try to use created() lifecycle hook instead of mounted()
Source:stackexchange.com