fuliqi
2024-04-19 fed41b2fd390ae729c05f63fcbc9f5e93cfd8f71
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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>