<template>
  <el-container>
    <el-aside>
      <!--    <el-radio-group v-model="isCollapse" style="margin-bottom: 20px;">
      <el-radio-button :label="false">展开</el-radio-button>
      <el-radio-button :label="true">收起</el-radio-button>
    </el-radio-group>-->
      <el-menu
        :default-active="this.$route.path"
        router
        class="el-menu-vertical-demo"
        :collapse="isCollapse"
        @open="handleOpen"
        @close="handleClose"
      >
        <el-submenu index="/my/account">
          <template slot="title">
            <i class="el-icon-user" />
            <span slot="title">帐号管理</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="/my/account/profile">
              <i class="el-icon-film" />
              <span slot="title">个人资料</span>
            </el-menu-item>
            <el-menu-item index="/my/account/vip">
              <i class="el-icon-film" />
              <span slot="title">小会员</span>
            </el-menu-item>
          </el-menu-item-group>
        </el-submenu>
        <el-submenu index="/my/post">
          <template slot="title">
            <i class="el-icon-postcard" />
            <span slot="title">稿件管理</span>
          </template>
          <el-submenu index="/my/post/publish">
            <template slot="title">
              <i class="el-icon-plus" />
              <span slot="title">发布</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="/my/post/publish/video">
                <i class="el-icon-film" />
                <span slot="title">视频</span>
              </el-menu-item>
              <el-menu-item index="/my/post/publish/audio">
                <i class="el-icon-headset" />
                <span slot="title">音频</span>
              </el-menu-item>
              <el-menu-item index="/my/post/publish/image">
                <i class="el-icon-picture" />
                <span slot="title">相册</span>
              </el-menu-item>
              <el-menu-item index="/my/post/publish/article">
                <i class="el-icon-document" />
                <span slot="title">文章</span>
              </el-menu-item>
              <el-menu-item index="/my/post/publish/file">
                <i class="el-icon-files" />
                <span slot="title">文件</span>
              </el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="/my/post/list">
            <template slot="title">
              <i class="el-icon-s-data" />
              <span slot="title">稿件</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="/my/post/list/video">
                <i class="el-icon-film" />
                <span slot="title">视频</span>
              </el-menu-item>
              <el-menu-item index="/my/post/list/audio">
                <i class="el-icon-headset" />
                <span slot="title">音频</span>
              </el-menu-item>
              <el-menu-item index="/my/post/list/image">
                <i class="el-icon-picture" />
                <span slot="title">相册</span>
              </el-menu-item>
              <el-menu-item index="/my/post/list/article">
                <i class="el-icon-document" />
                <span slot="title">文章</span>
              </el-menu-item>
            </el-menu-item-group>
          </el-submenu>
        </el-submenu>
        <el-submenu index="/my/post1">
          <template slot="title">
            <i class="el-icon-collection" />
            <span slot="title">收藏夹</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="/my/favlist/video">
              <i class="el-icon-film" />
              <span slot="title">视频</span>
            </el-menu-item>
            <el-menu-item index="/my/favlist/image">
              <i class="el-icon-picture" />
              <span slot="title">相册</span>
            </el-menu-item>
          </el-menu-item-group>
        </el-submenu>
        <el-menu-item index="/my/visit">
          <i class="el-icon-document" />
          <span slot="title">历史记录</span>
        </el-menu-item>
      </el-menu>
    </el-aside>
    <el-main>
      <!--      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item v-text="this.$router.currentRoute.name"></el-breadcrumb-item>
      </el-breadcrumb>-->
      <router-view />
    </el-main>
  </el-container>
</template>

<script>
export default {
  data() {
    return {
      isCollapse: false,
      navList: [
        { path: '/post/publish', name: '发布', icon: 'el-icon-upload' },
        { path: '/post/list', name: '稿件', icon: 'el-icon-files' },
        { path: '/post/analysis', name: '数据', icon: 'el-icon-data-analysis' }
      ]
    }
  },
  created() {
    document.title = '我的主页'
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath)
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath)
    }
  }
}
</script>

<style>
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 800px;
}
</style>
