From 384ac43370137b2b695397243827492dc032421d Mon Sep 17 00:00:00 2001 From: ikmkj <1@qq,com> Date: Thu, 31 Jul 2025 18:50:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(menu):=20=E6=B7=BB=E5=8A=A0=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E9=A1=B9=E9=9A=90=E8=97=8F=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 ElSubMenu 组件中添加 popperClass 属性,根据菜单是否折叠来决定是否隐藏- 在样式中添加 .hide-popper 类,用于隐藏菜单项 --- biji-qianduan/src/components/HomePage.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/biji-qianduan/src/components/HomePage.vue b/biji-qianduan/src/components/HomePage.vue index 6a4fbbb..569bc18 100644 --- a/biji-qianduan/src/components/HomePage.vue +++ b/biji-qianduan/src/components/HomePage.vue @@ -448,7 +448,10 @@ const renderMenu = (item) => { }); if (item.children && item.children.length > 0) { - return h(ElSubMenu, { index: `group-${item.id}` }, { + return h(ElSubMenu, { + index: `group-${item.id}`, + popperClass: isCollapsed.value ? 'hide-popper' : '' + }, { title: () => h('div', { onClick: () => selectFile(item), style: 'width: 100%;' }, [ wrappedContent() ]), default: () => item.children.map(child => renderMenu(child)) }); @@ -837,6 +840,10 @@ watch(activeMenu, (newVal) => { background-color: var(--primary-color-light) !important; } +.hide-popper { + display: none !important; +} + /* 移除预览中代码块的内部滚动条 */ .markdown-preview .vditor-reset pre { max-height: none !important;