From d387848d15a40fb16c8a6eefb007d5f7411c5dbc Mon Sep 17 00:00:00 2001
From: ZhangXianQiang <1135831638@qq.com>
Date: 星期日, 28 四月 2024 13:32:27 +0800
Subject: [PATCH] fix:修改图片浏览组件

---
 src/views/screen/components/screen-map-three/index.vue |   28 +++++++++++++++++++++++++---
 1 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/src/views/screen/components/screen-map-three/index.vue b/src/views/screen/components/screen-map-three/index.vue
index 1d010f4..806fa3e 100644
--- a/src/views/screen/components/screen-map-three/index.vue
+++ b/src/views/screen/components/screen-map-three/index.vue
@@ -1,5 +1,5 @@
 <template>
-  <div class="map-container" >
+  <div class="map-container">
     <canvas class="world" ref="worldContainer"></canvas>
   </div>
 </template>
@@ -9,9 +9,28 @@
 let world = null;
 export default {
   name: 'ScreenMapThree',
+  props: {
+    loadEnd: {
+      type: Boolean,
+      default: false
+    },
+  },
+  watch: {
+    loadEnd: {
+      handler(newVal) {
+        if (newVal) {
+          world = new Experience(this.$refs.worldContainer);
+        }
+      }
+    }
+  },
   mounted() {
-    world = new Experience(this.$refs.worldContainer);
-  }
+
+  },
+  beforeDestroy() {
+    world.destroy();
+    world = null;
+  },
 }
 </script>
 
@@ -20,7 +39,10 @@
   width: 100%;
   height: 100%;
   position: absolute;
+  left: 0;
+  top: 0;
   z-index: 0;
+
   .world {
     width: 100%;
     height: 100%;

--
Gitblit v1.8.0