data中
timer: null,
onceClick() {
let timers = this.timer;
if (timers) {
window.clearTimeout(timers);
this.timer = null;
} else {
this.timer = window.setTimeout(() => {
console.log("我是单击事件");
}, 300);
}
},
twoDBClick() {
let timers = this.timer;
if (timers) {
window.clearTimeout(timers);
this.timer = null;
}
console.log("我是双击事件");
this.dialogVisible = !this.dialogVisible;
},