From 39e7d257caeae7c241544af7281be1d70747bb8a Mon Sep 17 00:00:00 2001 From: ZhangXianQiang <1135831638@qq.com> Date: 星期五, 19 四月 2024 15:23:07 +0800 Subject: [PATCH] Merge branch 'dev-threejs' --- src/views/screen/components/screen-map-three/index.vue | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/views/screen/components/screen-map-three/index.vue b/src/views/screen/components/screen-map-three/index.vue index af189c1..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> @@ -18,15 +18,19 @@ watch: { loadEnd: { handler(newVal) { - console.log(newVal); - if(newVal) { + if (newVal) { world = new Experience(this.$refs.worldContainer); } } } }, mounted() { - } + + }, + beforeDestroy() { + world.destroy(); + world = null; + }, } </script> @@ -38,6 +42,7 @@ left: 0; top: 0; z-index: 0; + .world { width: 100%; height: 100%; -- Gitblit v1.8.0