|
@@ -5,7 +5,7 @@
|
5
|
5
|
|
6
|
6
|
<script setup>
|
7
|
7
|
import { onBeforeUnmount, onMounted, ref } from 'vue';
|
8
|
|
-import { useRouter } from 'vue-router';
|
|
8
|
+import { useRouter, onBeforeRouteUpdate, onBeforeRouteLeave } from 'vue-router';
|
9
|
9
|
import FireWorkListVue from '@/components/FireWorkList.vue';
|
10
|
10
|
import game from "./game.js";
|
11
|
11
|
|
|
@@ -44,13 +44,23 @@ import { useRouter } from 'vue-router';
|
44
|
44
|
})
|
45
|
45
|
}
|
46
|
46
|
|
|
47
|
+ onBeforeRouteUpdate(() => {
|
|
48
|
+ console.log('--------ref----<', el)
|
|
49
|
+ })
|
|
50
|
+
|
|
51
|
+ onBeforeRouteLeave(() => {
|
|
52
|
+ console.log('--------onBeforeRouteLeave----<')
|
|
53
|
+ })
|
|
54
|
+
|
47
|
55
|
onMounted(() => {
|
48
|
56
|
gameInit()
|
|
57
|
+ console.log('--------onMounted----<', el)
|
49
|
58
|
})
|
50
|
59
|
|
51
|
60
|
onBeforeUnmount(() => {
|
|
61
|
+ console.log('--------onBeforeUnmount----<', el)
|
52
|
62
|
if (destroyRef.value) {
|
53
|
|
- destroyRef.value();
|
|
63
|
+ destroyRef.value.destroy();
|
54
|
64
|
}
|
55
|
65
|
})
|
56
|
66
|
|