From fed41b2fd390ae729c05f63fcbc9f5e93cfd8f71 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期五, 19 四月 2024 15:56:03 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/screen/components/screen-map-three/index.vue | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 51 insertions(+), 0 deletions(-) diff --git a/src/views/screen/components/screen-map-three/index.vue b/src/views/screen/components/screen-map-three/index.vue new file mode 100644 index 0000000..806fa3e --- /dev/null +++ b/src/views/screen/components/screen-map-three/index.vue @@ -0,0 +1,51 @@ +<template> + <div class="map-container"> + <canvas class="world" ref="worldContainer"></canvas> + </div> +</template> + +<script> +import Experience from './experience/index'; +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() { + + }, + beforeDestroy() { + world.destroy(); + world = null; + }, +} +</script> + +<style lang="scss" scoped> +.map-container { + width: 100%; + height: 100%; + position: absolute; + left: 0; + top: 0; + z-index: 0; + + .world { + width: 100%; + height: 100%; + } +} +</style> \ No newline at end of file -- Gitblit v1.8.0