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.
- [Vuejs]-How to pass events from a non-Vue member object
- [Vuejs]-How to hide password with emoji instead of an asterisk (VueJS)
Source:stackexchange.com