<template>
  <el-container class="main">
    <el-header height="80px" class="main-header">
      <h2>Shipber UI</h2>
    </el-header>
    <el-container>
      <el-aside width="240px">
        <el-menu
          default-active="2"
          class="el-menu-vertical-demo"
          router
          style="height: 100%"
        >
          <el-menu-item
            v-for="(menu, index) in arrComponents"
            :key="index"
            :index="menu.path"
          >
            <template slot="title">
              <span>{{ menu.label }}</span>
            </template>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import { components } from '@/router';

@Component({})
export default class App extends Vue {
  private arrComponents = components;
}
</script>

<style lang="scss">
.main {
  height: 100%;
  width: 1140px;
  margin: auto;

  .main-header {
    border-bottom: 1px solid #dcdfe6;
    display: flex;
    align-items: center;
  }
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100vh;
}
</style>
