fix: 🐛 默认设置明亮模式无效问题修复

This commit is contained in:
hxr 2023-10-26 00:09:39 +08:00
parent f4cba1a368
commit 9bb8e4646e
2 changed files with 6 additions and 1 deletions

View File

@ -54,7 +54,7 @@ const defaultSettings: DefaultSettings = {
fixedHeader: false,
sidebarLogo: true,
layout: "left", // 默认左侧模式
theme: "light", // 默认暗黑模式
theme: "light", // 暗黑模式-dark 明亮模式-light
size: "default",
language: "zh-cn",
themeColor: "#409EFF",

View File

@ -18,6 +18,11 @@ export const useSettingsStore = defineStore("setting", () => {
"themeColor",
defaultSettings.themeColor
);
const theme = useStorage<string>("theme", defaultSettings.theme);
if (theme.value == "light") {
document.body.classList.remove("dark");
}
// actions
function changeSetting(param: { key: string; value: any }) {
const { key, value } = param;