num:0,//點擊次數
timer0:'',//第一次點擊的時間
timer4:'',//第四次點擊的時間
centerDialogVisible: false
// 連續4次點擊顯示模態框
changeAccount(){
this.num++
if(this.num==1){
this.timer0=new Date().getTime()/1000
}
if(this.num==4){
this.timer4= new Date().getTime()/1000
if(this.timer4-this.timer0<=3){
// this.isShow=!this.isShow
this.num=0
this.centerDialogVisible=true
}else {
this.num=0
}
}
},
*****************************************************************
我做的一個循環 當點擊第四次的時候 判斷時間間隔是不是<=3秒 如果真 則顯示且計數=0 如果假 計數=0 【其實不管真假num都為0】
