[Vuejs]-Vue.js cannot understand the problem here

0👍

The problem in your code is the part of the arrow function:

.then(response => {
   this.list = response.data.data;
})

in this case the this doesn’t refer to the vue object. Instead you should use the function bind() like so:

.then(function(response) {
   this.list = response.data.data;
}.bind(this))

Now the this reference in the function is a reference to the vue object.

Leave a comment