标签:嵌套 cti mount 刷新 mat index pat active str
<el-menu :default-active="activeIndex" @select="handleSelect" router></el-menu>
data () {
return {
activeIndex: '/'
}
},
watch: {
'$route' () {
this.handleSelect(this.activeIndex)
}
},
mounted () {
this.activeIndex = this.$route.matched[0].path || '/'
},
methods: {
handleSelect (index) {
this.activeIndex = index
}
},
这样就OK了
标签:嵌套 cti mount 刷新 mat index pat active str
原文地址:https://www.cnblogs.com/zheroXH/p/11613079.html