fix(modules/web): fix ElemetPlus theme not respect Reader theme

This commit is contained in:
Xwite
2024-10-02 21:38:40 +08:00
parent 01b031806b
commit f5ec50156a
2 changed files with 13 additions and 1 deletions
+13
View File
@@ -2,5 +2,18 @@ import { createApp } from "vue";
import App from "./App.vue";
import router from "@/router";
import store from "@/store";
import "element-plus/theme-chalk/dark/css-vars.css"
createApp(App).use(store).use(router).mount("#app");
// 同步Element PLUS 夜间模式
watch(
() => useBookStore().isNight,
(isNight) => {
if (isNight) {
document.documentElement.classList.add("dark");
} else {
document.documentElement.classList.remove("dark");
}
}
)