解决:
setStyle() { this.active = this.$route.meta.activeStyle; },
{ path: '/', name: 'home', component: Home, meta: { activeStyle: 'Home', }, }, { path: '/index', name: 'index', component: Index, meta: { activeStyle: 'Home', }, },
由home页面跳转到index页面,index页面公共导航栏的样式会与home页面一样