优化侧边栏菜单显示

This commit is contained in:
不做码农 2023-08-18 12:14:55 +08:00
parent 8eb8480265
commit 7a989d3db5

View File

@ -6,13 +6,10 @@
<svg-icon :name="onlyOneChild.meta.icon || (item.meta && item.meta.icon)" />
<span v-if="props.isCollapse && !onlyOneChild.meta.icon">{{ hasTitle2(onlyOneChild.meta.title) }}</span>
<template v-if="onlyOneChild.meta.titleKey" #title>
{{ $t(onlyOneChild.meta.titleKey) }}
<svg-icon name="new" color="#fff" style="width: 60px; height: 30px" v-if="onlyOneChild.meta.isNew == 1" />
</template>
<template v-else-if="onlyOneChild.meta.title" #title>
{{ onlyOneChild.meta.title }}
<template #title>
<span v-if="onlyOneChild.meta.titleKey">{{ $t(onlyOneChild.meta.titleKey) }}</span>
<span v-else-if="onlyOneChild.meta.title">{{ onlyOneChild.meta.title }}</span>
<svg-icon name="new" color="#fff" style="width: 50px; height: 25px" v-if="onlyOneChild.meta.title && onlyOneChild.meta.isNew == 1" />
</template>
</el-menu-item>
</app-link>
@ -23,6 +20,7 @@
<svg-icon :name="item.meta && item.meta.icon" />
<span v-if="item.meta && item.meta.titleKey">{{ $t(item.meta.titleKey) }}</span>
<span v-else-if="item.meta && item.meta.title">{{ item.meta.title }}</span>
<svg-icon name="new" color="#fff" style="width: 50px; height: 25px" v-if="item.meta.title && item.meta.isNew == 1" />
</template>
<sidebar-item v-for="child in item.children" :key="child.path" :is-nest="true" :item="child" :base-path="resolvePath(child.path)" />