From 885cd2f84aff3f0182791c7e65bce0b51268528a Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Fri, 12 Apr 2024 16:53:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=B4=E9=83=A8=E8=8F=9C=E5=8D=95=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/CategoryHeader.vue | 8 +++++++- src/layout/components/useRenderLayout.tsx | 4 ++-- src/styles/var.css | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/layout/components/CategoryHeader.vue b/src/layout/components/CategoryHeader.vue index af962f15a..483a48de8 100644 --- a/src/layout/components/CategoryHeader.vue +++ b/src/layout/components/CategoryHeader.vue @@ -49,7 +49,7 @@ export default defineComponent({ id={`${variables.namespace}-tool-header`} class={[ prefixCls, - 'h-[var(--top-tool-height)] relative px-[var(--top-tool-p-x)] flex items-center justify-between', + 'h-[var(--top-category-height)] relative px-[var(--top-tool-p-x)] flex items-center justify-between', 'dark:bg-[var(--el-bg-color)]' ]} > @@ -64,6 +64,12 @@ export default defineComponent({ const { renderMenuTitle } = useRenderMenuTitle() const categoryRouters = unref(routers).filter(item=>item.meta.hidden!=true&&item.path!='/') console.log('categoryRouters==',categoryRouters) + //默认展开第一行 + if(categoryRouters.length>0){ + appStore.setCategoryRoutePath(categoryRouters[0].path) + } + + {/* default: () => renderMenuTitle(onlyOneChild ? onlyOneChild?.meta : meta) */} return categoryRouters.map((v) => { const meta = (v.meta ?? {}) as RouteMeta diff --git a/src/layout/components/useRenderLayout.tsx b/src/layout/components/useRenderLayout.tsx index 4d9ea8335..77f95156e 100644 --- a/src/layout/components/useRenderLayout.tsx +++ b/src/layout/components/useRenderLayout.tsx @@ -78,7 +78,7 @@ export const useRenderLayout = () => {
{ class={[ `${prefixCls}-content-scrollbar`, { - '!h-[calc(100%-var(--top-tool-height)-var(--tags-view-height))] mt-[calc(var(--top-tool-height)+var(--tags-view-height))]': + '!h-[calc(100%-var(--top-tool-height)-var(--top-category-height)-var(--tags-view-height))] mt-[calc(var(--top-tool-height)+var(--tags-view-height))]': fixedHeader.value } ]} diff --git a/src/styles/var.css b/src/styles/var.css index 63459ba63..55535b7a9 100644 --- a/src/styles/var.css +++ b/src/styles/var.css @@ -32,6 +32,7 @@ --top-header-hover-color: #f6f6f6; --top-tool-height: var(--logo-height); + --top-category-height: var(--logo-height); --top-tool-p-x: 0;