diff --git a/src/messages/common_cn.js b/src/messages/common_cn.js index 6f20622..1ab97d3 100644 --- a/src/messages/common_cn.js +++ b/src/messages/common_cn.js @@ -41,6 +41,7 @@ common.label.clear = '清空' common.label.tabMode = '多标签模式' common.label.cachedTabMode = '缓存标签页' common.label.showTabIcon = '标签图标' +common.label.showMenuIcon = '菜单图标' common.label.keywords = '关键字' common.label.breadcrumb = '面包屑导航' common.label.username = '用户名' diff --git a/src/messages/common_en.js b/src/messages/common_en.js index fb40373..b7a4b85 100644 --- a/src/messages/common_en.js +++ b/src/messages/common_en.js @@ -41,6 +41,7 @@ common.label.clear = 'Clear' common.label.tabMode = 'Tabs Mode' common.label.cachedTabMode = 'Cache Tabs' common.label.showTabIcon = 'Tab Icon' +common.label.showMenuIcon = 'Menu Icon' common.label.keywords = 'Keywords' common.label.breadcrumb = 'Breadcrumb' common.label.username = 'User Name' diff --git a/src/stores/GlobalConfigStore.js b/src/stores/GlobalConfigStore.js index b63e8b9..44fab34 100644 --- a/src/stores/GlobalConfigStore.js +++ b/src/stores/GlobalConfigStore.js @@ -6,11 +6,15 @@ import { changeMessages } from '@/messages' export const useGlobalConfigStore = defineStore('globalConfig', () => { const currentLocale = ref(GlobalLocales.CN) - const isDarkTheme = useDark() + const systemKey = import.meta.env.VITE_APP_SYSTEM_KEY + const isDarkTheme = useDark({ + storageKey: `__${systemKey}__vueuse-color-scheme` + }) const isCollapseLeft = ref(false) const isShowSettings = ref(false) const isShowBreadcrumb = ref(true) - const layoutMode = ref(GlobalLayoutMode.LEFT) + const showMenuIcon = ref(true) + const layoutMode = ref(GlobalLayoutMode.TOP) return { currentLocale, isDarkTheme, @@ -18,6 +22,7 @@ export const useGlobalConfigStore = defineStore('globalConfig', () => { isShowSettings, isShowBreadcrumb, layoutMode, + showMenuIcon, changeLocale (locale) { if (Object.values(GlobalLocales).includes(locale)) { currentLocale.value = locale diff --git a/src/views/components/global/GlobalSettings.vue b/src/views/components/global/GlobalSettings.vue index 054e620..b5ae5f5 100644 --- a/src/views/components/global/GlobalSettings.vue +++ b/src/views/components/global/GlobalSettings.vue @@ -50,6 +50,12 @@ const options = [ value: GlobalLayoutMode.TOP }] }, + { + labelKey: 'common.label.showMenuIcon', + prop: 'showMenuIcon', + type: 'switch', + model: globalConfigStore + }, { labelKey: 'common.label.breadcrumb', prop: 'isShowBreadcrumb',