perf: 样式调整

This commit is contained in:
rd
2025-08-19 10:43:53 +08:00
parent 98440ac638
commit b717c7629f
2 changed files with 35 additions and 35 deletions

View File

@ -27,6 +27,14 @@ 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(() => { const collapsed = computed(() => {
return sidebarStore.menuCollapse; return sidebarStore.menuCollapse;
}); });
@ -45,6 +53,7 @@ const checkHasInviteCode = () => {
joinModalRef.value?.getEnterprise?.(); joinModalRef.value?.getEnterprise?.();
} }
}; };
</script> </script>
<template> <template>
@ -61,16 +70,20 @@ const checkHasInviteCode = () => {
collapsible collapsible
trigger trigger
@collapse="setCollapsed" @collapse="setCollapsed"
class="layout-sider"
> >
<section class="menu-wrapper">
<SiderBar /> <SiderBar />
</section>
</Layout.Sider> </Layout.Sider>
<Layout class="flex-1 layout-content"> <Layout.Content
<div class="py-16px pr-16px"> class="layout-content"
:style="{
paddingLeft: sidebarStore.sidebarWidth + 'px',
}"
>
<div :class="layoutPageClass">
<layout-page /> <layout-page />
</div> </div>
</Layout> </Layout.Content>
</Layout> </Layout>
</Layout> </Layout>
</template> </template>
@ -86,50 +99,37 @@ const checkHasInviteCode = () => {
line-height: $navbar-height; line-height: $navbar-height;
padding-inline: inherit; padding-inline: inherit;
color: inherit; color: inherit;
position: fixed;
top: 0;
left: 0;
z-index: 9999;
width: 100%;
} }
.layout-content-wrap { .layout-content-wrap {
width: 100%;
height: 100%; height: 100%;
background: transparent; background: transparent;
min-height: calc(100vh - $navbar-height); min-height: calc(100vh - $navbar-height);
:deep(.ant-layout-sider) { :deep(.ant-layout-sider) {
background: none; background: none;
box-shadow: none; box-shadow: none;
padding-top: $navbar-height;
padding-bottom: 0; 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 { .ant-layout-sider-trigger {
display: none; display: none;
} }
.ant-layout-sider-children { .ant-layout-sider-children {
overflow: hidden; 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 { .layout-content {
height: 100%; padding-top: $navbar-height;
overflow-y: scroll;
overflow-x: auto;
background: transparent; background: transparent;
transition: padding 0.2s cubic-bezier(0.34, 0.69, 0.1, 1); transition: padding 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
} }

View File

@ -4,7 +4,7 @@
<img src="@/assets/img/icon-logo.png" alt="" width="96" height="24" /> <img src="@/assets/img/icon-logo.png" alt="" width="96" height="24" />
</div> </div>
<div class="flex-1"> <div class="flex-1">
<MiddleSide v-if="!isAgentRoute" /> <MiddleSide />
</div> </div>
<RightSide :isAgentRoute="isAgentRoute" v-if="userStore.isLogin" /> <RightSide :isAgentRoute="isAgentRoute" v-if="userStore.isLogin" />
</div> </div>