<template>
  <el-aside class="sidebar-container">
      <div class="logo">
          <img :src="logo" alt="平台logo" v-if="logo">
          <h1>{{name}}</h1>
      </div>
      <el-scrollbar class="scrollbar-wrapper">
          <el-menu :default-active="matchPath" class="el-menu-vertical-demo sidebar-menu"
                   :background-color="theme.sidebarColor"
                   text-color="#cccccc"
                   active-text-color="#ffffff"
                   unique-opened
                   router
                   :collapse="isCollapsed">
              <sidebar-item :menuData='menuData' :isLimitLevel="isLimitLevel"></sidebar-item>
          </el-menu>
      </el-scrollbar>
  </el-aside>
</template>

<script>
import sidebarItem from './sidebarItem';

export default {
    props: {
        theme: {
            type: Object
        },
        isCollapsed: {
            type: Boolean
        },
        menuData: {
            type: Array
        },
        logo: {
            type: String
        },
        name: {
            type: String
        },
        isLimitLevel: {
            type: Boolean,
            default: false
        },
        matchPath: {
            type: String,
            default: ''
        }
    },
    components: {sidebarItem},
    data () {
        return {};
    },
    created () {
    },
    methods: {
    }
};
</script>
