实现思想:路由相同时css不变,用了this.$route.query
参考demo 部分:
{{item.name}}
script部分:
export default {
data() {
return {
getMenuItems: [
{
'name': '鹰眼快讯',
'path': '/',
'class': 'clock-o'
},
{
'name': '会议',
'path': '/act',
'class': 'video-o'
},
{
'name': 'VIP',
'path': '/vip',
'class': 'gem-o'
},
{
'name': '研究',
'path': '/article',
'class': 'notes-o'
},
{
'name': '我的',
'path': '/about',
'class': 'manager-o'
}
],
ind: '0'
}
},
mounted(){
if (this.$route.query) {
this.ind = this.$route.query;
} else {
this.ind = 0;
}
},
//方法
methods: {
check_show(index){
this.ind = index;
}
},
}
QQ截图20191203105851.png