Reputation: 637
I have a function that does 2 things. I want to wait for the first line and then execute the second line. The first line is a simple assignment. How can I do this using async-await without making the first assignment a function. The following code gives me an error in line 2.
async eg(){
await a = b;
c.focus();
}
Upvotes: 0
Views: 1009
Reputation: 30
eg() {
this.a = this.b;
setTimeout(() => {
this.$refs["c"].focus();
}, 1);
}
Upvotes: 2