clickTimer = null;
click() {
if (this.clickTimer) {
window.clearTimeout(this.clickTimer);
this.clickTimer = null;
}
this.clickTimer = window.setTimeout(function () {
console.log('你单击了');
}, 300);
}
dblclick() {
if (this.clickTimer) {
window.clearTimeout(this.clickTimer);
this.clickTimer = null;
}
console.log(`你双击了`);
}