1.左侧菜单选中样式问题
在SidebarItem,vue文件中新增style样式
<style scoped>
/* 设置选中后的菜单背景颜色 */
.el-menu-item.is-active{
/*一级*/
background: #4D67DF !important;
}
#app .sidebar-container .nest-menu .el-submenu > .el-submenu__title, #app .sidebar-container .el-submenu .el-menu-item.is-active{
/*一级以外*/
background: #4D67DF !important;
}
</style>
2.处理3级菜单只有一个页面时不显示问题
创建一个二级菜单,设置不显示在侧边栏,把三级页面放里面就ok了
{
path: '/studentList',
component: Layout,
alwaysShow: true,
redirect: '/studentList/index',
meta: { title: '学员管理', icon: 'student' },
children: [
{
path: 'index',
name: 'studentList',
component: () => import('@/views/studentList/index'),
meta: { title: '学员列表' ,icon:'none' },
},
{ //新建的二级。要跳转的三级写在这里
path: 'index',
name: 'studentList',
component: () => import('@/views/studentList/indexI'),
meta: { title: '学员列表' ,icon:'none' },
hidden:true,
children:[
{
path: '/studentList/editStuden',
name: 'editStuden',
component: () => import('@/views/studentList/editStuden/index'),
meta: { title: '编辑资料' ,icon:'none'},
hidden:true
}
]
}
]
},