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(`你雙擊了`); }