diff --git a/src/App.vue b/src/App.vue index 80fcc63a..9ca43214 100644 --- a/src/App.vue +++ b/src/App.vue @@ -42,6 +42,9 @@ const appStore = useAppStore(); const isMain = ref(true as boolean); onMounted(async () => { + // 获取当前主题 + const theme = appStore.theme; + document.documentElement.className = theme; // 获取当前窗口 const win = window.getCurrent(); isMain.value = win.label === "tauri-genshin"; @@ -93,7 +96,7 @@ async function writeIndex () { diff --git a/src/assets/index.css b/src/assets/index.css index 0a27cbf5..15a3a7f3 100644 --- a/src/assets/index.css +++ b/src/assets/index.css @@ -1,4 +1,6 @@ @import "fonts/index.css"; +@import url("themes/default.css"); +@import url("themes/dark.css"); /* * @description 侧边滚动条样式 diff --git a/src/components/t-sidebar.vue b/src/components/t-sidebar.vue index eb85d5be..755a6ddf 100644 --- a/src/components/t-sidebar.vue +++ b/src/components/t-sidebar.vue @@ -1,5 +1,5 @@ --> + + +