From 52a5d064a576938433eb5dc017a53b1d70cb5cfe Mon Sep 17 00:00:00 2001 From: april Date: Mon, 14 Aug 2023 18:20:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AF=BC=E8=88=AA=E6=B7=B7=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 5942884a809813c87b6e49cefd4343aa07169b91 --- src/layout/components/Sidebar/LeftMenu.vue | 41 ++++++++++ src/layout/components/Sidebar/TopMenu.vue | 52 ++++++++++++ src/layout/components/Sidebar/index.vue | 92 ++++++++++++++++------ src/layout/index.vue | 80 ++++++++++++++----- src/layout/main.vue | 57 ++++++++++++++ src/store/modules/app.ts | 12 ++- 6 files changed, 287 insertions(+), 47 deletions(-) create mode 100644 src/layout/components/Sidebar/LeftMenu.vue create mode 100644 src/layout/components/Sidebar/TopMenu.vue create mode 100644 src/layout/main.vue 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, }; });