fix: 🐛 登录页设置的主题进入系统后不一致问题修复
Former-commit-id: 0f6344792e06a2c0b0e669d29d4e4f3797b10d7a
This commit is contained in:
@@ -20,9 +20,7 @@ export const useSettingsStore = defineStore("setting", () => {
|
||||
);
|
||||
|
||||
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;
|
||||
@@ -47,6 +45,9 @@ export const useSettingsStore = defineStore("setting", () => {
|
||||
break;
|
||||
case "theme":
|
||||
theme.value = value;
|
||||
if (theme.value !== "dark") {
|
||||
document.documentElement.classList.remove("dark");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user