I'm playing around something like this
myFunc(){
new Promise(function(resolve,reject){
setTimeout(function(){
//
resolve();
},1000)
})
.then(function(){
this.a = 10;
});
console.log(this.a)
}
I want to update the vue data property a
inside a nested function. What's wrong here ? Note that I cann't use arrow function here for some reason.
Fiddle link: https://jsfiddle.net/bkvcy6j2/