更换事件
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { ref, watch, onMounted, onUnmounted } from "vue";
|
||||
import { ref, watch, onMounted, onBeforeUnmount } from "vue";
|
||||
import { onShow } from "@dcloudio/uni-app";
|
||||
import { isGamingAPI, getCurrentGameAPI } from "@/apis";
|
||||
import { debounce } from "@/util";
|
||||
@@ -49,7 +49,7 @@ const gameOver = () => {
|
||||
onMounted(() => {
|
||||
uni.$on("game-over", gameOver);
|
||||
});
|
||||
onUnmounted(() => {
|
||||
onBeforeUnmount(() => {
|
||||
uni.$off("game-over", gameOver);
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user