mirror of
https://github.com/EasyTier/EasytierGame.git
synced 2025-05-19 10:27:56 +00:00
26 lines
528 B
Vue
26 lines
528 B
Vue
<template>
|
|
<NuxtPage />
|
|
</template>
|
|
|
|
<script setup lang="tsx">
|
|
import { onBeforeUnmount } from "vue";
|
|
import { getCurrentWindow } from "@tauri-apps/api/window";
|
|
import { listen } from "@tauri-apps/api/event";
|
|
|
|
const appWindow = getCurrentWindow();
|
|
|
|
const unlisten = listen("window-close-event", (event) => {
|
|
closeApp();
|
|
});
|
|
|
|
onBeforeUnmount(() => {
|
|
unlisten.then((unlisten) => {
|
|
unlisten && unlisten instanceof Function && unlisten();
|
|
});
|
|
});
|
|
|
|
const closeApp = async () => {
|
|
appWindow.hide();
|
|
};
|
|
</script>
|