answerTimer() {
if (!this.isClick) {
this.timer3 = setInterval(() => {
this.canRun = false;
let obj = {};
obj.questId = this.questionList[this.questionNum].id;
obj.choice = "";
this.choiceList.push(obj);
this.next();
}, 2000)
}
},
next() {
this.isClick = false;
setTimeout(() => {
this.n = -1;
this.canRun = true;
if(this.questionNum < this.questionList.length - 1){
this.questionNum++;
} else {
this.questionNum = 0;
}
},100)
},
changeConfirm(idx, choice) {
if (!this.canRun) {
return
}
this.canRun = false;
clearInterval(this.timer3)
this.isClick = true;
let arr = this.choiceList;
arr.push({
'questId': this.questionList[this.questionNum].id,
choice: choice
});
this.n = idx;
this.next();
this.answerTimer()
},
vue选择题,两秒不选跳下一题
最新推荐文章于 2025-03-08 11:14:41 发布