style: SidebarItem 组件

This commit is contained in:
pany
2022-10-08 15:19:36 +08:00
parent 5c0a8379c2
commit ce8c736043
5 changed files with 26 additions and 16 deletions

View File

@@ -72,7 +72,7 @@ const resolvePath = (routePath: string) => {
<SidebarItemLink v-if="theOnlyOneChild.meta" :to="resolvePath(theOnlyOneChild.path)">
<el-menu-item :index="resolvePath(theOnlyOneChild.path)">
<svg-icon v-if="theOnlyOneChild.meta.svgIcon" :name="theOnlyOneChild.meta.svgIcon" />
<component v-else-if="theOnlyOneChild.meta.elIcon" class="el-icon" :is="theOnlyOneChild.meta.elIcon" />
<component v-else-if="theOnlyOneChild.meta.elIcon" :is="theOnlyOneChild.meta.elIcon" class="el-icon" />
<template v-if="theOnlyOneChild.meta.title" #title>
{{ theOnlyOneChild.meta.title }}
</template>
@@ -82,7 +82,7 @@ const resolvePath = (routePath: string) => {
<el-sub-menu v-else :index="resolvePath(props.item.path)" popper-append-to-body>
<template #title>
<svg-icon v-if="props.item.meta && props.item.meta.svgIcon" :name="props.item.meta.svgIcon" />
<component v-else-if="props.item.meta && props.item.meta.elIcon" class="el-icon" :is="props.item.meta.elIcon" />
<component v-else-if="props.item.meta && props.item.meta.elIcon" :is="props.item.meta.elIcon" class="el-icon" />
<span v-if="props.item.meta && props.item.meta.title">{{ props.item.meta.title }}</span>
</template>
<template v-if="props.item.children">
@@ -101,15 +101,17 @@ const resolvePath = (routePath: string) => {
<style lang="scss" scoped>
.svg-icon {
margin-right: 8px;
min-width: 1em;
font-size: 16px;
margin-right: 12px;
font-size: 18px;
}
.el-icon {
width: 1em;
height: 1em;
margin-right: 8px;
margin-right: 12px;
font-size: 18px;
}
.simple-mode {
&.first-level {
:deep(.el-sub-menu) {