I'm currently using a vue
. I'm having a problem with my data
, because when it inside the $.each
loop it becomes undefined.
export default{
data() {
return {
list: ['sample 1', 'sample 2']
}
},
methods: {
updateList(){
this.form.get('/tasks/get')
.then(data => {
console.log(this.list); //displays all list
$.each(data.data, function(key, value) {
console.log(this.list); //returns undefined
});
}
}
}
}
Someone knows how to fix this?