Explorar el Código

fix: 修复平面图底部出现popover的问题

yunxing hace 4 años
padre
commit
99a346774f
Se han modificado 1 ficheros con 6 adiciones y 10 borrados
  1. 6 10
      src/components/floorMap/index.vue

+ 6 - 10
src/components/floorMap/index.vue

@@ -714,19 +714,15 @@ export default {
         },
         /**
          * @description 处理popover显隐
-         * 当点击位置不在canvas内部时 ( 如点击 页面空白,图例,楼层,设备设施左侧列表项时),将popover的display置为none,
-         * 当点击位置在canvas内部时,将popover的display设置为'block'
+         * 当点击位置不在canvas内部时 ( 如点击 页面空白,图例,楼层,设备设施左侧列表项时),将visible置为false,隐藏popover
          */
         handlePopover(e) {
-            if (this.$refs.graphy.contains(e.target)) {
-                if (this.$refs.popover && this.$refs.popover.popperElm) {
-                    this.$refs.popover.popperElm.style.display = 'block'
-                }
-            } else {
-                if (this.$refs.popover && this.$refs.popover.popperElm) {
-                    this.$refs.popover.popperElm.style.display = 'none'
+            this.$nextTick(()=>{
+                if(!this.$refs.graphy.contains(e.target)){
+                    console.log(1111)
+                    this.visible = false
                 }
-            }
+            })
         },
     },
     watch: {