perf: 走查问题调整,修改sidebar结构

This commit is contained in:
rd
2025-08-29 16:44:27 +08:00
parent a9e49faf66
commit 7f493b8014
11 changed files with 109 additions and 80 deletions

View File

@ -23,9 +23,6 @@ const route = useRoute();
useResponsive(true);
const showSider = computed(() => {
return !route.meta?.hideSidebar;
});
const isHomeRoute = computed(() => {
return route.name === 'Home';
});
@ -43,20 +40,10 @@ const layoutPageClass = computed(() => {
return result;
});
const siderWidth = computed(() => {
return showSider.value ? sidebarStore.sidebarWidth : 0;
});
const collapsed = computed(() => {
return sidebarStore.menuCollapse;
});
onMounted(() => {
checkHasInviteCode();
});
const setCollapsed = (val) => {
appStore.updateSettings({ menuCollapse: val });
};
const checkHasInviteCode = () => {
const inviteCode = getQueryParam('invite_code');
@ -74,21 +61,11 @@ const checkHasInviteCode = () => {
<Navbar />
</Layout.Header>
<Layout class="flex layout-content-wrap">
<Layout.Sider
v-if="showSider"
v-model="collapsed"
:width="siderWidth"
collapsible
trigger
@collapse="setCollapsed"
class="layout-sider"
>
<SiderBar />
</Layout.Sider>
<SiderBar />
<Layout
class="layout-content"
:style="{
paddingLeft: `${siderWidth}px`,
paddingLeft: `${sidebarStore.sidebarWidth}px`,
}"
>
<Layout.Content :class="layoutPageClass" class="!min-h-initial">