<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="#fff"
        text-color="#333333"
        active-text-color="#3F70FF"
      >
        <sidebar-item
          :routes="permissionRouters"
          :is-collapse="isCollapse" />
      </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>
