From 0eb0b7395ea64a4f750b429a2546a038fd27ec30 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Wed, 29 Dec 2021 13:26:56 +0800 Subject: [PATCH] perf: layout style --- src/layout/components/appMain.vue | 18 ++-- src/layout/components/navbar.vue | 20 +++-- src/layout/components/setting/index.vue | 10 ++- src/layout/components/sidebar/horizontal.vue | 19 +++-- src/layout/components/sidebar/sidebarItem.vue | 84 +++++++++++++------ src/layout/components/tag/index.vue | 25 ++++-- 6 files changed, 117 insertions(+), 59 deletions(-) diff --git a/src/layout/components/appMain.vue b/src/layout/components/appMain.vue index 35211bbf6..534928f71 100644 --- a/src/layout/components/appMain.vue +++ b/src/layout/components/appMain.vue @@ -29,10 +29,21 @@ const transitions = computed(() => { const hideTabs = computed(() => { return instance?.sets.hideTabs; }); + const layout = computed(() => { return instance?.layout.layout === "vertical"; }); +const getSectionStyle = computed(() => { + return [ + hideTabs.value && layout ? "padding-top: 48px;" : "", + !hideTabs.value && layout ? "padding-top: 85px;" : "", + hideTabs.value && !layout.value ? "padding-top: 48px" : "", + !hideTabs.value && !layout.value ? "padding-top: 85px;" : "", + props.fixedHeader ? "" : "padding-top: 0;" + ]; +}); + const transitionMain = defineComponent({ render() { return h( @@ -71,12 +82,7 @@ const transitionMain = defineComponent({