Jelajahi Sumber

优化右键重复点击

JX.LI 2 tahun lalu
induk
melakukan
148a8eaa61
1 mengubah file dengan 6 tambahan dan 0 penghapusan
  1. 6 0
      src/components/supermap-2.5d.vue

+ 6 - 0
src/components/supermap-2.5d.vue

@@ -64,6 +64,7 @@
           mapData: null,
           mapName: null
         },
+        clickTime: new Date().getTime()
       }
     },
     watch: {},
@@ -476,6 +477,11 @@
         let that = this;
         that.handler.setInputAction(function(movement) {
           that.mapshow = false
+          if (new Date().getTime() - that.clickTime < 2000) {
+            return
+          } else {
+            that.clickTime = new Date().getTime()
+          }
           clearInterval(that.timer)
           that.timer = null
           // 监听鼠标的当前位置坐标,然后根据当前坐标去动态更新气泡窗口div的显示位置;