From ca10d104c0f0d6eae488e8688039672ad48dd3f8 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Fri, 19 Aug 2022 09:44:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BD=93=E6=B2=A1=E6=9C=89icon=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=9E=82=E7=9B=B4=E5=AF=BC=E8=88=AA=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=8A=98=E5=8F=A0=E6=96=87=E5=AD=97=E8=A2=AB=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/sidebar/sidebarItem.vue | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/src/layout/components/sidebar/sidebarItem.vue b/src/layout/components/sidebar/sidebarItem.vue index c9596e219..b1df79898 100644 --- a/src/layout/components/sidebar/sidebarItem.vue +++ b/src/layout/components/sidebar/sidebarItem.vue @@ -3,12 +3,10 @@ import path from "path"; import { childrenType } from "../../types"; import { useNav } from "/@/layout/hooks/useNav"; import { transformI18n } from "/@/plugins/i18n"; -import { useAppStoreHook } from "/@/store/modules/app"; import { useRenderIcon } from "/@/components/ReIcon/src/hooks"; import { ref, toRaw, PropType, nextTick, computed, CSSProperties } from "vue"; -const { pureApp } = useNav(); -const menuMode = ["vertical", "mix"].includes(pureApp.layout); +const { layout, isCollapse } = useNav(); const props = defineProps({ item: { @@ -25,7 +23,7 @@ const props = defineProps({ }); const getExtraIconStyle = computed((): CSSProperties => { - if (useAppStoreHook().getSidebarStatus) { + if (!isCollapse.value) { return { position: "absolute", right: "10px" @@ -46,7 +44,7 @@ const getNoDropdownStyle = computed((): CSSProperties => { const getDivStyle = computed((): CSSProperties => { return { - width: pureApp.sidebar.opened ? "" : "100%", + width: !isCollapse.value ? "" : "100%", display: "flex", alignItems: "center", justifyContent: "space-between", @@ -64,7 +62,7 @@ const getMenuTextStyle = computed(() => { const getSubTextStyle = computed((): CSSProperties => { return { - width: pureApp.sidebar.opened ? "210px" : "", + width: !isCollapse.value ? "210px" : "", display: "inline-block", overflow: "hidden", textOverflow: "ellipsis" @@ -159,9 +157,19 @@ function resolvePath(routePath) {
+ + {{ transformI18n(onlyOneChild.meta.title) }} + +
+
@@ -171,7 +179,7 @@ function resolvePath(routePath) {