data:{
btnTimes: 5, //设置倒计时5s
}
countdown: function(){
this.timer = setInterval(()=>{
this.btnTimes--;
if(this.btnTimes == 0){
clearInterval(this.timer);
// do something...
}
},1000);
},
data:{
btnTimes: 5, //设置倒计时5s
}
countdown: function(){
this.timer = setInterval(()=>{
this.btnTimes--;
if(this.btnTimes == 0){
clearInterval(this.timer);
// do something...
}
},1000);
},