diff --git a/src/layout/components/Sidebar/LeftMenu.vue b/src/layout/components/Sidebar/LeftMenu.vue new file mode 100644 index 00000000..bae939cf --- /dev/null +++ b/src/layout/components/Sidebar/LeftMenu.vue @@ -0,0 +1,41 @@ + + diff --git a/src/layout/components/Sidebar/TopMenu.vue b/src/layout/components/Sidebar/TopMenu.vue new file mode 100644 index 00000000..35db809c --- /dev/null +++ b/src/layout/components/Sidebar/TopMenu.vue @@ -0,0 +1,52 @@ + + diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index 3eb734ae..16f36850 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -1,18 +1,15 @@ diff --git a/src/layout/index.vue b/src/layout/index.vue index 0d2e4589..7e3109bc 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -1,13 +1,15 @@ + diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts index cd1c1860..b538d0cf 100644 --- a/src/store/modules/app.ts +++ b/src/store/modules/app.ts @@ -14,11 +14,12 @@ export const useAppStore = defineStore("app", () => { const language = useStorage("language", defaultSettings.language); const sidebarStatus = useStorage("sidebarStatus", "closed"); + const sidebar = reactive({ opened: sidebarStatus.value !== "closed", withoutAnimation: false, }); - + const activeTopMenu = useStorage("activeTop", ""); /** * 根据语言标识读取对应的语言包 */ @@ -68,18 +69,25 @@ export const useAppStore = defineStore("app", () => { function changeLanguage(val: string) { language.value = val; } - + /** + * 混合模式顶部切换 + */ + function changeTopActive(val: string) { + activeTopMenu.value = val; + } return { device, sidebar, language, locale, size, + activeTopMenu, toggleDevice, changeSize, changeLanguage, toggleSidebar, closeSideBar, openSideBar, + changeTopActive, }; });