[Vuejs]-Why Vuejs does not want to update the model from the data received through AJAX

0👍

Generally speaking, these issues are down to Vue’s issues with reactivity and arrays: https://v2.vuejs.org/v2/guide/reactivity.html

With this in mind, you could try:

this.$set(this, 'items', response.data.items) instead of this.items = response.data.items

This forces Vue to rebind that instance variable with the new items instead.

It’s also worth noting, you need a key on your loop:

<tr v-for="item in items" :key="item.id"> – You’ll likely have a console error stating the same.

Leave a comment