jinjianback1.1/src/views/layout/components/Sidebar/index.vue

29 lines
679 B
Vue
Raw Normal View History

2017-06-26 13:38:24 +08:00
<template>
2017-11-24 16:30:40 +08:00
<scroll-bar>
<el-menu mode="vertical" unique-opened :default-active="$route.path" :collapse="isCollapse" background-color="#304156" text-color="#fff" active-text-color="#409EFF">
<sidebar-item :routes='routes'></sidebar-item>
</el-menu>
</scroll-bar>
2017-06-26 13:38:24 +08:00
</template>
<script>
2017-11-24 16:30:40 +08:00
import { mapGetters } from 'vuex'
2017-08-30 17:42:06 +08:00
import SidebarItem from './SidebarItem'
2017-11-24 16:30:40 +08:00
import ScrollBar from '@/components/ScrollBar'
2017-08-30 17:42:06 +08:00
export default {
2017-11-24 16:30:40 +08:00
components: { SidebarItem, ScrollBar },
2017-08-30 17:42:06 +08:00
computed: {
2017-11-24 16:30:40 +08:00
...mapGetters([
'sidebar'
]),
2017-10-18 15:05:30 +08:00
routes() {
return this.$router.options.routes
2017-11-24 16:30:40 +08:00
},
isCollapse() {
return !this.sidebar.opened
2017-10-18 15:05:30 +08:00
}
2017-08-30 17:42:06 +08:00
}
}
2017-06-26 13:38:24 +08:00
</script>