After clicking the "stopCrash" button, I want the function backAgain
to be executed 2 seconds later. However, I am encountering an error in the console: Uncaught TypeError: this.backAgain is not a function.
Do you have any suggestions on how to fix this issue?
methods:{
backAgain(){
this.winning = 0;
this.betAmount = 0;
this.moneyValue = null;
},
cashOut(){
clearTimeout(this.tessst);
this.money = Number(this.money) + Number(this.winning);
setTimeout(function(){
this.backAgain()
},2000)
}}
<button class="stopCrash" @click="cashOut">Cash out</button>