
<template>
  <div >
    <el-container style="min-height: 550px">
      <el-aside width="210px" style="background-color: rgb(84, 92, 100);">
        <!--左侧菜单组件-->
        <el-menu
          default-active="2"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="red" router>
          <el-menu-item index="/dashboard" class="is-active">
            <i class="el-icon-menu "></i>
            <span slot="title">服务首页</span>
          </el-menu-item>
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-bank-card"></i>
              <span>我的钱包</span>
            </template>
            <el-menu-item index="/account">我的账户</el-menu-item>
            <el-menu-item index="/cardticket">我的卡券</el-menu-item>
          </el-submenu>
          <el-menu-item index="/order">
            <i class="el-icon-tickets"></i>
            <span slot="title">我的订单</span>
          </el-menu-item>
          <el-menu-item index="/payback">
            <i class="el-icon-finished"></i>
            <span slot="title">欠费补缴</span>
          </el-menu-item>
          <el-menu-item index="/mycar">
            <i class="el-icon-truck"></i>
            <span slot="title">我的车辆</span>
          </el-menu-item>
          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-user-solid"></i>
              <span>个人中心</span>
            </template>
            <el-menu-item index="/information">个人资料</el-menu-item>
            <el-menu-item index="/myevaluate">我的评价</el-menu-item>
          </el-submenu>
        </el-menu>
      </el-aside>

      <el-main class="app-container">
        <router-view :key="key" />
      </el-main>
    </el-container>

  </div>

</template>

<script>
  export default {
    computed: {
      key() {
        return this.index
      }
    },
    methods: {
      handleOpen(key, keyPath) {
        console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        console.log(key, keyPath);
      }
    }
  }

</script>
<style scoped>

</style>
