element ui table单双击事件耦合解决办法

参考:

https://www.jb51.net/article/137956.htm

在vue 里面可以定义一个变量 time

大约如下写法:

 getclick() {
      if (this.time) {
        clearTimeout(this.time);
      }
      this.time = setTimeout(() => {
        console.log(‘我是单机’);
      }, 300); //大概时间300ms
    },
    getdbClick() {
      if (this.time) {
        clearTimeout(this.time); //清除
      }
 //这里处理双击事件
    },

就是说300毫秒以内连续点击都不能触发单击事件

原文地址:https://www.cnblogs.com/llcdbk/p/12750717.html