<template>
  <el-scrollbar wrapClass="scrollbar-wrapper">
    <el-menu
      router
      :default-active="defaultActive"
      class="el-menu-sidebar"
      active-text-color='#29A88D'
      background-color="#1a76a5"
      text-color="#fff"
      unique-opened>
      <NavMenu :navMenus="menusArr"></NavMenu>
    </el-menu>
  </el-scrollbar>
</template>

<script>
import request from '@/utils/request'
import NavMenu from '@/components/TreeMenu'
export default {
  name: 'LeftMenus',
  components: {
    NavMenu
  },
  data() {
    return {
      defaultActive: '0',
      menusArr: []
    }
  },
  created() {
    var that = this
    var date = new Date()
    var timer = date.getTime().toString()
    request.get('../../../static/menu.json?t=' + timer, {}, function(res) {
      that.menusArr = res.data
    })
  }
}
</script>

<style scoped>

</style>
