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

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

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