// 2秒内5连击(默认)________________________ multiClick( multiClickCallback, singleClickCallback, maxTimes = 5, time = 2000 ) { this.clickTimes || (this.clickTimes = 0); ++this.clickTimes >= maxTimes && (multiClickCallback && multiClickCallback(), singleClickCallback || (this.clickTimes = 0)); this.clickTimes === 1 && setTimeout(() => { this.clickTimes < maxTimes && singleClickCallback && singleClickCallback(); //执行单击or少于maxTimes次的点击 this.clickTimes = 0; }, time); }, // 双击场景demo________________________ triggerMultiClick(data, node) { this.multiClick( () => { // 双击 }, () => { // 单击 },2,300 ); },