Browse Source

优化测边栏logo

master
bylxc 5 years ago
parent
commit
8ad9a91ce0
  1. 3
      src/router/index.js
  2. 12
      src/views/layout/components/Sidebar/SidebarItem.vue

3
src/router/index.js

@ -49,7 +49,8 @@ export const constantRouterMap = [
component: _import('xm/core/xmProject/XmProjectMng'),
name: 'dashboard',
meta: { title: 'dashboard', icon: 'home-page', noCache: true }
}]
}],
hidden: true
}
]

12
src/views/layout/components/Sidebar/SidebarItem.vue

@ -1,22 +1,16 @@
<template>
<div class="menu-wrapper">
<!-- <template>
<template>
<router-link to="/">
<div class="logo" :class="{'has-logo': isCollapse}">
<img v-if="isCollapse" src="../../../../assets/image/logo1.png" alt="" />
<img v-else src="../../../../assets/image/logo2.png" alt="" />
</div>
</router-link>
</template> -->
</template>
<template v-for="item in routes" v-if="!item.hidden&&item.children">
<router-link v-if="hasOneShowingChildren(item.children) && !item.children[0].children&&!item.alwaysShow&&!item.path" to="/" :key="item.children[0].name">
<el-menu-item :index="item.path+'/'+item.children[0].path" class="logo" :class="{'submenu-title-noDropdown-logo':!isNest, 'has-logo': isCollapse}">
<img v-if="isCollapse" src="../../../../assets/image/logo1.png" alt="" />
<img v-else src="../../../../assets/image/logo2.png" alt="" />
</el-menu-item>
</router-link>
<router-link v-else-if="hasOneShowingChildren(item.children) && !item.children[0].children&&!item.alwaysShow" :to="item.path+'/'+item.children[0].path"
<router-link v-if="hasOneShowingChildren(item.children) && !item.children[0].children&&!item.alwaysShow" :to="item.path+'/'+item.children[0].path"
:key="item.children[0].name">
<el-menu-item :index="item.path+'/'+item.children[0].path" :class="{'submenu-title-noDropdown':!isNest}">
<svg-icon v-if="item.children[0].meta&&item.children[0].meta.icon" :icon-class="item.children[0].meta.icon"></svg-icon>

Loading…
Cancel
Save