From 9888eb4278a2c74f8533b468bba958cfffb7b125 Mon Sep 17 00:00:00 2001 From: birt <2499248221@qq.com> Date: 星期日, 13 四月 2025 22:12:11 +0800 Subject: [PATCH] 折叠 --- zhitan-vue/src/layout/index.vue | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/zhitan-vue/src/layout/index.vue b/zhitan-vue/src/layout/index.vue index 7cb8e3e..00a46f1 100644 --- a/zhitan-vue/src/layout/index.vue +++ b/zhitan-vue/src/layout/index.vue @@ -119,21 +119,25 @@ // 鐩戝惉璺敱鍙樺寲锛屽鐞嗛椤电殑渚ц竟鏍忔樉绀� watchEffect(() => { - // 妫�鏌ユ槸鍚︽槸棣栭〉璺敱 - if (route.path === '/index' || route.path === '/') { + // 妫�鏌ユ槸鍚︽槸棣栭〉璺敱锛屼絾鎺掗櫎/index/index瀛愯矾鐢� + if ((route.path === '/index' || route.path === '/') && route.path !== '/index/index') { // 棣栭〉璺敱锛岀‘淇濅晶杈规爮涓嶉殣钘忥紝浣嗙姸鎬佹槸鎶樺彔鐨� - appStore.showCollapsedSidebar() + appStore.toggleSideBarHide(false) // 鏀逛负涓嶉殣钘忎晶杈规爮 } else if (route.meta && route.meta.showSidebar === false) { // 濡傛灉璺敱鏄庣‘鎸囧畾闅愯棌渚ц竟鏍� appStore.toggleSideBarHide(true) + } else { + // 鍏朵粬璺敱锛岀‘淇濅晶杈规爮鍙 + appStore.toggleSideBarHide(false) } }) // 缁勪欢鎸傝浇鏃讹紝纭繚棣栭〉渚ц竟鏍忕姸鎬佹纭� onMounted(() => { - // 濡傛灉褰撳墠鏄椤碉紝纭繚渚ц竟鏍忔槸鎶樺彔鐨勮�屼笉鏄殣钘忕殑 - if (route.path === '/index' || route.path === '/') { - appStore.showCollapsedSidebar() + // 濡傛灉褰撳墠鏄椤碉紝纭繚渚ц竟鏍忓彲瑙� + if (route.path === '/index/index') { + appStore.toggleSideBarHide(false) + appStore.sidebar.opened = true } }) -- Gitblit v1.9.3