|
|
|
@ -1,7 +1,6 @@ |
|
|
|
|
<template> |
|
|
|
|
<div> |
|
|
|
|
<el-menu |
|
|
|
|
class="sidebar-el-menu" |
|
|
|
|
<el-menu class="sidebar-el-menu" |
|
|
|
|
:default-active="onRoutes" |
|
|
|
|
background-color="#324157" |
|
|
|
|
text-color="#bfcbd9" |
|
|
|
@ -9,38 +8,33 @@ |
|
|
|
|
unique-opened |
|
|
|
|
mode="horizontal" |
|
|
|
|
router |
|
|
|
|
@select="handleSelect" |
|
|
|
|
> |
|
|
|
|
@select="handleSelect"> |
|
|
|
|
<template v-for="item in menus"> |
|
|
|
|
<template v-if="item.subs"> |
|
|
|
|
<el-submenu :index="item.index" :key="item.index"> |
|
|
|
|
<el-submenu :index="item.index" |
|
|
|
|
:key="item.index"> |
|
|
|
|
<template slot="title"> |
|
|
|
|
<i :class="item.icon"></i> |
|
|
|
|
<span slot="title">{{ item.title }}</span> |
|
|
|
|
</template> |
|
|
|
|
<template v-for="subItem in item.subs"> |
|
|
|
|
<el-submenu |
|
|
|
|
v-if="subItem.subs" |
|
|
|
|
<el-submenu v-if="subItem.subs" |
|
|
|
|
:index="subItem.index" |
|
|
|
|
:key="subItem.index" |
|
|
|
|
> |
|
|
|
|
:key="subItem.index"> |
|
|
|
|
<template slot="title">{{ subItem.title }}</template> |
|
|
|
|
<el-menu-item |
|
|
|
|
v-for="(threeItem,i) in subItem.subs" |
|
|
|
|
<el-menu-item v-for="(threeItem,i) in subItem.subs" |
|
|
|
|
:key="i" |
|
|
|
|
:index="threeItem.index" |
|
|
|
|
>{{ threeItem.title }}</el-menu-item> |
|
|
|
|
:index="threeItem.index">{{ threeItem.title }}</el-menu-item> |
|
|
|
|
</el-submenu> |
|
|
|
|
<el-menu-item |
|
|
|
|
v-else |
|
|
|
|
<el-menu-item v-else |
|
|
|
|
:index="subItem.index" |
|
|
|
|
:key="subItem.index" |
|
|
|
|
>{{ subItem.title }}</el-menu-item> |
|
|
|
|
:key="subItem.index">{{ subItem.title }}</el-menu-item> |
|
|
|
|
</template> |
|
|
|
|
</el-submenu> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
|
<el-menu-item :index="item.index" :key="item.index"> |
|
|
|
|
<el-menu-item :index="item.index" |
|
|
|
|
:key="item.index"> |
|
|
|
|
<i :class="item.icon"></i> |
|
|
|
|
<span slot="title">{{ item.title }}</span> |
|
|
|
|
</el-menu-item> |
|
|
|
@ -138,7 +132,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
|
sessionStorage.getItem('sideBar') && this.handleSelect(sessionStorage.getItem('sideBar')) |
|
|
|
|
// sessionStorage.getItem('sideBar') && this.handleSelect(sessionStorage.getItem('sideBar')) |
|
|
|
|
sessionStorage.getItem('token') && this.getPer() // 登录了才获取权限 |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|