✏️ 修复 IDE import 报错

This commit is contained in:
目棃
2024-06-26 22:03:22 +08:00
parent 7ea47b4606
commit 8a4edd29f5
77 changed files with 316 additions and 284 deletions

View File

@@ -9,10 +9,10 @@
</template>
<script lang="ts" setup>
import { event } from "@tauri-apps/api";
import { UnlistenFn } from "@tauri-apps/api/helpers/event";
import { UnlistenFn, Event } from "@tauri-apps/api/helpers/event";
import { computed, onMounted, onUnmounted } from "vue";
import { useAppStore } from "../../store/modules/app";
import { useAppStore } from "../../store/modules/app.js";
const appStore = useAppStore();
const themeGet = computed({
@@ -35,17 +35,13 @@ async function switchTheme(): Promise<void> {
}
async function listenOnTheme(): Promise<UnlistenFn> {
return await event.listen<string>("readTheme", (e) => {
return await event.listen("readTheme", (e: Event<string>) => {
const theme = e.payload;
themeGet.value = theme === "default" ? "default" : "dark";
});
}
onUnmounted(() => {
if (themeListener) {
themeListener();
}
});
onUnmounted(() => themeListener());
</script>
<style lang="css" scoped>
.switch-box {