<el-menu
class="el_head_menu"
mode="horizontal"
background-color="#3989e1"
text-color="#fff"
active-text-color="#ffd04b"
router
:default-active="$route.path"
>
<el-menu-item v-for="(item, index) in activePathList" :key="index" :index="item.path">
{{ item.navName }}
</el-menu-item>
</el-menu>
上面主要是靠 $route.path,就不用在本地缓存了