From b3dc9a7a436626fe2b89f24c69f26e9badfeafd2 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期三, 28 五月 2025 14:42:17 +0800 Subject: [PATCH] 菜单样式修改 --- src/layout/components/Sidebar/index.vue | 3 +-- src/store/modules/app.js | 12 +++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index be695d1..c472bf3 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -9,7 +9,7 @@ :text-color="getMenuTextColor" :unique-opened="true" :active-text-color="theme" - :collapse-transition="false" + :collapse-transition="true" mode="vertical" :class="sideTheme" > @@ -41,7 +41,6 @@ const showLogo = computed(() => settingsStore.sidebarLogo) const sideTheme = computed(() => settingsStore.sideTheme) const theme = computed(() => settingsStore.theme) -const isCollapse = computed(() => !appStore.sidebar.opened) // 鑾峰彇鑿滃崟鑳屾櫙鑹� const getMenuBackground = computed(() => { diff --git a/src/store/modules/app.js b/src/store/modules/app.js index eb8a847..0c1a7f8 100644 --- a/src/store/modules/app.js +++ b/src/store/modules/app.js @@ -14,7 +14,17 @@ }), actions: { toggleSideBar(withoutAnimation) { - return true + console.log('toggleSideBar', withoutAnimation) + if (this.sidebar.hide) { + return false + } + this.sidebar.opened = !this.sidebar.opened + this.sidebar.withoutAnimation = withoutAnimation + if (this.sidebar.opened) { + Cookies.set('sidebarStatus', 1) + } else { + Cookies.set('sidebarStatus', 0) + } }, closeSideBar({ withoutAnimation }) { Cookies.set('sidebarStatus', 0) -- Gitblit v1.9.3