diff --git a/src/layout/components/Settings/index.vue b/src/layout/components/Settings/index.vue index eb1d8d96..d5fe2e23 100644 --- a/src/layout/components/Settings/index.vue +++ b/src/layout/components/Settings/index.vue @@ -29,7 +29,7 @@
{{ $t("settings.sidebarColorScheme") }} - + {{ $t("settings.minimalWhite") }} @@ -53,7 +53,9 @@ const route = useRoute(); const appStore = useAppStore(); const settingsStore = useSettingsStore(); const permissionStore = usePermissionStore(); + const isDark = ref(settingsStore.theme === ThemeEnum.DARK); +const sidebarColor = computed(() => settingsStore.sidebarColorScheme); const settingsVisible = computed({ get() { @@ -84,13 +86,12 @@ const changeTheme = (val: any) => { }; /** - * 更改侧边栏颜色方案 + * 更改侧边栏颜色 * * @param val 颜色方案名称 */ -const changeSidebarColorScheme = (val: any) => { - console.log(val); - settingsStore.changeSidebarColorScheme(val); +const changeSidebarColor = (val: any) => { + settingsStore.changeSidebarColor(val); }; /** diff --git a/src/store/modules/settings.ts b/src/store/modules/settings.ts index 12a58e50..41bfa4e7 100644 --- a/src/store/modules/settings.ts +++ b/src/store/modules/settings.ts @@ -67,7 +67,7 @@ export const useSettingsStore = defineStore("setting", () => { theme.value = val; } - function changeSidebarColorScheme(val: string) { + function changeSidebarColor(val: string) { sidebarColorScheme.value = val; } @@ -92,6 +92,6 @@ export const useSettingsStore = defineStore("setting", () => { changeTheme, changeThemeColor, changeLayout, - changeSidebarColorScheme, + changeSidebarColor, }; });