menu 支持 icon 嵌套

This commit is contained in:
Pan 2017-07-28 15:52:22 +08:00 committed by 花裤衩
parent 69fc52d4e9
commit 108b380d20
4 changed files with 7 additions and 11 deletions

File diff suppressed because one or more lines are too long

View file

@ -7,17 +7,13 @@
margin-right: 16px; margin-right: 16px;
} }
.hideSidebar .svg-icon {
margin-right: 0;
}
.hideSidebar .el-submenu>.el-submenu__title, .hideSidebar .el-submenu>.el-submenu__title,
.hideSidebar .submenu-title-noDropdown { .hideSidebar .submenu-title-noDropdown {
padding-left: 10px!important; padding-left: 10px!important;
} }
.hideSidebar .submenu-title-noDropdown span, .hideSidebar .submenu-title-noDropdown span,
.hideSidebar .el-submenu>.el-submenu__title span { .hideSidebar .el-submenu>.el-submenu__title>span {
height: 0; height: 0;
width: 0; width: 0;
overflow: hidden; overflow: hidden;
@ -32,6 +28,7 @@
height: auto; height: auto;
width: auto; width: auto;
visibility: visible; visibility: visible;
display: inline;
} }
.el-submenu__icon-arrow { .el-submenu__icon-arrow {
display: block!important; display: block!important;
@ -65,6 +62,8 @@
visibility: visible; visibility: visible;
position: absolute; position: absolute;
right: -145px; right: -145px;
text-align: left;
text-indent: 20px;
top: 0px; top: 0px;
background-color: #1f2d3d; background-color: #1f2d3d;
opacity: 1; opacity: 1;

View file

@ -51,9 +51,6 @@
left: 0; left: 0;
z-index: 1001; z-index: 1001;
background: red; background: red;
// overflow-y: auto;
&::-webkit-scrollbar {display:none}
} }
.main-container { .main-container {
min-height: 100%; min-height: 100%;

View file

@ -10,7 +10,7 @@
<el-submenu :index="item.name" v-if="!item.noDropdown&&!item.hidden"> <el-submenu :index="item.name" v-if="!item.noDropdown&&!item.hidden">
<template slot="title"> <template slot="title">
<icon-svg v-if='item.icon' :icon-class="item.icon"></icon-svg><span slot="title">{{item.name}}</span> <icon-svg v-if='item.icon' :icon-class="item.icon"></icon-svg><span>{{item.name}}</span>
</template> </template>
<template v-for="child in item.children" v-if='!child.hidden'> <template v-for="child in item.children" v-if='!child.hidden'>
@ -18,7 +18,7 @@
<router-link v-else :to="item.path+'/'+child.path"> <router-link v-else :to="item.path+'/'+child.path">
<el-menu-item :index="item.path+'/'+child.path"> <el-menu-item :index="item.path+'/'+child.path">
<span slot="title">{{child.name}}</span> <icon-svg v-if='child.icon' :icon-class="child.icon"></icon-svg><span>{{child.name}}</span>
</el-menu-item> </el-menu-item>
</router-link> </router-link>