parent
e50eda0900
commit
e83aac6942
6 changed files with 229 additions and 56 deletions
@ -0,0 +1,146 @@ |
||||
<template> |
||||
<div class="sidebar"> |
||||
<el-menu :default-active="active" background-color="#fff" text-color="#333" active-text-color="#062c87" router> |
||||
<template v-for="item in menus"> |
||||
<template v-if="item.children"> |
||||
<el-submenu :index="item.index" :key="item.index"> |
||||
<template slot="title"> |
||||
<span slot="title">{{ item.title }}</span> |
||||
</template> |
||||
<template v-for="subItem in item.children"> |
||||
<el-submenu v-if="subItem.children" :index="subItem.index" :key="subItem.index"> |
||||
<template slot="title">{{ subItem.title }}</template> |
||||
<el-menu-item v-for="(threeItem, i) in subItem.children" :key="i" :index="threeItem.index">{{ |
||||
threeItem.title |
||||
}}</el-menu-item> |
||||
</el-submenu> |
||||
<el-menu-item v-else :index="subItem.index" :key="subItem.index">{{ subItem.title }}</el-menu-item> |
||||
</template> |
||||
</el-submenu> |
||||
</template> |
||||
<template v-else> |
||||
<el-menu-item :index="item.index" :key="item.index"> |
||||
<span slot="title">{{ item.title }}</span> |
||||
</el-menu-item> |
||||
</template> |
||||
</template> |
||||
</el-menu> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
props: ['path'], |
||||
data () { |
||||
return { |
||||
active: '', |
||||
menus: [ |
||||
{ |
||||
index: '/assessment', |
||||
title: '考核管理' |
||||
}, |
||||
{ |
||||
index: '/achievement', |
||||
title: '成绩管理' |
||||
}, |
||||
{ |
||||
index: '/evaluation', |
||||
title: '测评管理' |
||||
}, |
||||
{ |
||||
index: '/course', |
||||
title: '精品课程管理' |
||||
}, |
||||
{ |
||||
index: '/review', |
||||
title: '评阅中心' |
||||
}, |
||||
{ |
||||
index: '/information', |
||||
title: '资讯管理' |
||||
}, |
||||
{ |
||||
index: '/project', |
||||
title: '项目管理' |
||||
}, |
||||
{ |
||||
index: '/resourse', |
||||
title: '资源库' |
||||
}, |
||||
{ |
||||
index: '/exam', |
||||
title: '理论考试系统' |
||||
}, |
||||
{ |
||||
index: '/exam1', |
||||
title: '备课管理' |
||||
}, |
||||
], |
||||
}; |
||||
}, |
||||
watch: { |
||||
path: { |
||||
handler (val) { |
||||
this.active = val |
||||
}, |
||||
immediate: true |
||||
} |
||||
}, |
||||
mounted () { |
||||
|
||||
}, |
||||
methods: { |
||||
handleSelect (index) { |
||||
|
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.sidebar { |
||||
width: 160px; |
||||
height: calc(100vh - 193px); |
||||
overflow: auto; |
||||
transition: .5s; |
||||
transform: translateX(-200px); |
||||
|
||||
&.show { |
||||
transform: translateX(0); |
||||
} |
||||
|
||||
/deep/.el-menu { |
||||
border-right: 0 !important; |
||||
|
||||
.el-menu-item, |
||||
.el-submenu__title { |
||||
height: 40px; |
||||
padding-left: 30px !important; |
||||
line-height: 40px; |
||||
|
||||
&.is-active { |
||||
font-weight: 600; |
||||
} |
||||
} |
||||
|
||||
.el-menu .el-menu-item { |
||||
padding: 0 20px 0 40px !important; |
||||
overflow: hidden; |
||||
text-overflow: ellipsis; |
||||
white-space: nowrap; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.sidebar::-webkit-scrollbar { |
||||
width: 0; |
||||
} |
||||
|
||||
.sidebar-el-menu:not(.el-menu--collapse) { |
||||
width: 100%; |
||||
} |
||||
|
||||
.sidebar>ul { |
||||
height: 100%; |
||||
} |
||||
</style> |
Loading…
Reference in new issue