<el-menu
router 把index转换为router模式,index===跟上hash
unique-opened 默认展开一项
:default-active="this.$route.path" 默认激活当前的index
class="el-menu-vertical-demo"
background-color="#545c64"
text-color="#fff"
active-text-color="#ffd04b">
没有儿子的菜单
<!-- 后台首页 -->
<el-menu-item index="/layout">
<i class="el-icon-menu"></i>
<span slot="title">后台首页</span>
</el-menu-item>
有儿子的菜单
<!-- 商品管理 -->
<el-submenu index="/goods">
<template slot="title">
<i class="el-icon-location"></i>
<span>商品管理</span>
</template>
<el-menu-item-group>
<el-menu-item index="/goods/goods-list">商品列表</el-menu-item>
<el-menu-item index="/goods/goods-add">商品添加</el-menu-item>
<el-menu-item index="/goods/goods-type">商品分类</el-menu-item>
</el-menu-item-group>
</el-submenu>
区分一下!!!
El-submenu 它的index 不会跳转,但是要配置,因为展开一项需要index来区分一下。
el-menu-item 它的index 才会跳转页面