vue+element-ui刷新左侧菜单部分不变为原来的状态
<el-menu :router='true' :default-active = currentMenu><public-left :navMenu = 'navMenu'></public-left></el-menu>
·
<el-menu :router='true' :default-active = currentMenu>
<public-left :navMenu = 'navMenu'></public-left>
</el-menu>
data部分:
data () {
return {
currentMenu: 'servePersonView'
}
},
script部分:
methods: {
getUrl () {
let currentUrl = window.location.href;
this.currentMenu = currentUrl.split('#')[1].split('/')[2];
}
},
created () {
this.getUrl();
}
更多推荐
已为社区贡献3条内容
所有评论(0)