|
@@ -2,8 +2,23 @@
|
|
|
<div :class="{ 'has-logo': showLogo }">
|
|
|
<logo v-if="showLogo" :collapse="isCollapse" />
|
|
|
<el-scrollbar wrap-class="scrollbar-wrapper">
|
|
|
- <el-menu class="navMenu" :default-active="activeMenu" :collapse="isCollapse" :background-color="variables.menusBg" :text-color="variables.menuText" :unique-opened="false" :active-text-color="variables.menuActiveText" :collapse-transition="false" mode="vertical">
|
|
|
- <sidebar-item v-for="(route, index) in permission_routes" :key="index" :item="route" :base-path="route.path" />
|
|
|
+ <el-menu
|
|
|
+ class="navMenu"
|
|
|
+ :default-active="activeMenu"
|
|
|
+ :collapse="isCollapse"
|
|
|
+ :background-color="variables.menusBg"
|
|
|
+ :text-color="variables.menuText"
|
|
|
+ :unique-opened="false"
|
|
|
+ :active-text-color="variables.menuActiveText"
|
|
|
+ :collapse-transition="false"
|
|
|
+ mode="vertical"
|
|
|
+ >
|
|
|
+ <sidebar-item
|
|
|
+ v-for="(route, index) in permission_routes"
|
|
|
+ :key="index"
|
|
|
+ :item="route"
|
|
|
+ :base-path="route.path"
|
|
|
+ />
|
|
|
</el-menu>
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
@@ -19,8 +34,11 @@ export default {
|
|
|
components: { SidebarItem, Logo },
|
|
|
computed: {
|
|
|
...mapGetters(["sidebar", "permission_routes"]),
|
|
|
- routes () {
|
|
|
- const power = typeof this.userPowerList == 'string' ? JSON.parse(this.userPowerList) : this.userPowerList;
|
|
|
+ routes() {
|
|
|
+ const power =
|
|
|
+ typeof this.userPowerList == "string"
|
|
|
+ ? JSON.parse(this.userPowerList)
|
|
|
+ : this.userPowerList;
|
|
|
return power;
|
|
|
// const datas = this.$router.options.routes;
|
|
|
// const arrs = [];
|
|
@@ -43,7 +61,7 @@ export default {
|
|
|
// return datas;
|
|
|
// }
|
|
|
},
|
|
|
- activeMenu () {
|
|
|
+ activeMenu() {
|
|
|
const route = this.$route;
|
|
|
const { meta, path } = route;
|
|
|
// if set path, the sidebar will highlight the path you set
|
|
@@ -52,13 +70,13 @@ export default {
|
|
|
}
|
|
|
return path;
|
|
|
},
|
|
|
- showLogo () {
|
|
|
+ showLogo() {
|
|
|
return this.$store.state.settings.sidebarLogo;
|
|
|
},
|
|
|
- variables () {
|
|
|
+ variables() {
|
|
|
return variables;
|
|
|
},
|
|
|
- isCollapse () {
|
|
|
+ isCollapse() {
|
|
|
return !this.sidebar.opened;
|
|
|
},
|
|
|
},
|