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) {