From b717c7629f49d97f6d0c8f67f0326a301a64ceb7 Mon Sep 17 00:00:00 2001 From: rd <1344903914@qq.com> Date: Tue, 19 Aug 2025 10:43:53 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/Basic.vue | 68 ++++++++++++------------- src/layouts/components/navbar/index.vue | 2 +- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/layouts/Basic.vue b/src/layouts/Basic.vue index bf7ea23..26c7f2f 100644 --- a/src/layouts/Basic.vue +++ b/src/layouts/Basic.vue @@ -24,9 +24,17 @@ const route = useRoute(); useResponsive(true); const showSider = computed(() => { - return !route.meta?.hideSidebar; + return !route.meta?.hideSidebar; }); +const isHomeRoute = computed(() => { + return route.name === 'Home'; +}); + +const layoutPageClass = computed(() => { + return isHomeRoute.value ? 'pb-8px pr-8px' : 'pb-24px pr-24px' +}) + const collapsed = computed(() => { return sidebarStore.menuCollapse; }); @@ -45,6 +53,7 @@ const checkHasInviteCode = () => { joinModalRef.value?.getEnterprise?.(); } }; + @@ -86,50 +99,37 @@ const checkHasInviteCode = () => { line-height: $navbar-height; padding-inline: inherit; color: inherit; + position: fixed; + top: 0; + left: 0; + z-index: 9999; + width: 100%; } .layout-content-wrap { + width: 100%; height: 100%; background: transparent; min-height: calc(100vh - $navbar-height); :deep(.ant-layout-sider) { background: none; box-shadow: none; + padding-top: $navbar-height; padding-bottom: 0; + position: fixed; + top: 0; + left: 0; + z-index: 9999; + height: 100%; + transition: all 0.2s cubic-bezier(0.34, 0.69, 0.1, 1); .ant-layout-sider-trigger { display: none; } .ant-layout-sider-children { overflow: hidden; } - .arco-menu-inner { - overflow: hidden; - padding: 16px !important; - } - .menu-wrapper { - height: 100%; - overflow: auto; - overflow-x: hidden; - :deep(.arco-menu) { - ::-webkit-scrollbar { - width: 12px; - height: 4px; - } - ::-webkit-scrollbar-thumb { - border: 4px solid transparent; - background-clip: padding-box; - border-radius: 7px; - background-color: var(--color-text-4); - } - ::-webkit-scrollbar-thumb:hover { - background-color: var(--color-text-3); - } - } - } } .layout-content { - height: 100%; - overflow-y: scroll; - overflow-x: auto; + padding-top: $navbar-height; background: transparent; transition: padding 0.2s cubic-bezier(0.34, 0.69, 0.1, 1); } diff --git a/src/layouts/components/navbar/index.vue b/src/layouts/components/navbar/index.vue index fd1cf8b..1cf2c2f 100644 --- a/src/layouts/components/navbar/index.vue +++ b/src/layouts/components/navbar/index.vue @@ -4,7 +4,7 @@
- +