<template>
  <el-scrollbar wrap-class="scrollbar-wrapper">
    <el-menu
      class="menu-bar"
      mode="vertical"
      :unique-opened="true"
      :show-timeout="200"
      :default-active="$route.path"
      :collapse="isCollapse"
      background-color="#1e282c"
      text-color="#bfcbd9"
      active-text-color="#fff">
      <sidebar-item :routes="permissionRouters"/>
    </el-menu>
  </el-scrollbar>
</template>

<script>
import { mapGetters } from 'vuex'
import SidebarItem from './SidebarItem'

export default {
  components: { SidebarItem },
  computed: {
    ...mapGetters([
      'permissionRouters',
      'sidebar'
    ]),
    isCollapse () {
      return !this.sidebar.opened
    }
  }
}
</script>
