From f1fc66a06b7f55c03f2a0ab08e86b5fee4156cca Mon Sep 17 00:00:00 2001 From: 龚焕茏 <2842157468@qq.com> Date: 星期二, 23 四月 2024 10:48:22 +0800 Subject: [PATCH] 合同导入模板 --- src/views/screen/components/screen-map-three/index.vue | 26 +++++++++++++++++++++++--- 1 files changed, 23 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 a117a58..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> @@ -23,6 +42,7 @@ left: 0; top: 0; z-index: 0; + .world { width: 100%; height: 100%; -- Gitblit v1.8.0