fix: 🐛 默认设置明亮模式无效问题修复
Former-commit-id: 9bb8e4646e8c4bd7ec38b9b4104b7f40d928629d
This commit is contained in:
@@ -54,7 +54,7 @@ const defaultSettings: DefaultSettings = {
|
|||||||
fixedHeader: false,
|
fixedHeader: false,
|
||||||
sidebarLogo: true,
|
sidebarLogo: true,
|
||||||
layout: "left", // 默认左侧模式
|
layout: "left", // 默认左侧模式
|
||||||
theme: "light", // 默认暗黑模式
|
theme: "light", // 暗黑模式-dark 明亮模式-light
|
||||||
size: "default",
|
size: "default",
|
||||||
language: "zh-cn",
|
language: "zh-cn",
|
||||||
themeColor: "#409EFF",
|
themeColor: "#409EFF",
|
||||||
|
|||||||
@@ -18,6 +18,11 @@ export const useSettingsStore = defineStore("setting", () => {
|
|||||||
"themeColor",
|
"themeColor",
|
||||||
defaultSettings.themeColor
|
defaultSettings.themeColor
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const theme = useStorage<string>("theme", defaultSettings.theme);
|
||||||
|
if (theme.value == "light") {
|
||||||
|
document.body.classList.remove("dark");
|
||||||
|
}
|
||||||
// actions
|
// actions
|
||||||
function changeSetting(param: { key: string; value: any }) {
|
function changeSetting(param: { key: string; value: any }) {
|
||||||
const { key, value } = param;
|
const { key, value } = param;
|
||||||
|
|||||||
Reference in New Issue
Block a user