mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-17 10:08:14 +08:00
♻️ 姑且能跑 dev,尚需调试功能
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { event } from "@tauri-apps/api";
|
||||
import { UnlistenFn } from "@tauri-apps/api/helpers/event";
|
||||
import { UnlistenFn } from "@tauri-apps/api/event";
|
||||
import { onMounted, onUnmounted, ref } from "vue";
|
||||
|
||||
import { saveImgLocal } from "../../utils/TGShare.js";
|
||||
@@ -59,7 +59,7 @@ const iconDark = ref<string>();
|
||||
const offer = ref<string>();
|
||||
|
||||
onMounted(async () => {
|
||||
themeListener = await event.listen("readTheme", (e) => {
|
||||
themeListener = event.listen("readTheme", (e) => {
|
||||
const theme = <string>e.payload;
|
||||
if (theme === "dark") {
|
||||
icon.value = iconLight.value;
|
||||
@@ -77,9 +77,7 @@ onMounted(async () => {
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
if (themeListener) {
|
||||
themeListener();
|
||||
}
|
||||
themeListener();
|
||||
const urlList = [iconLight.value, iconDark.value, offer.value];
|
||||
urlList.forEach((url) => {
|
||||
URL.revokeObjectURL(typeof url === "string" ? url : "");
|
||||
|
||||
Reference in New Issue
Block a user