0👍
The problem is with the if (this.done)
check.
When done
is false, the promise is never resolved, and the handleStart never receives data.
If you need to react when a data
has changed, take a look Vue’s watchers
- [Vuejs]-V-checkboxes are true when the page is loaded
- [Vuejs]-Vue sending data to other components is one step behind
0👍
you need to use watchers to watch this.done
change
watch: {
done(newVal, oldVal) {
if (newVal) {
// do something
}
}
},
methods: {
async handleStart () {
// how to make this async
this.start = true
const data = await this.foo()
console.log("I must be printed with:", data))
}
}
- [Vuejs]-Bootstrap Tab with VueJS 1.0.28 not working properly while working with Vue 1.0.18
- [Vuejs]-How to assign function to question in POST?
Source:stackexchange.com