<!-- <div class="home-icon" @click="category = !category"> -->
<div v-if="isShow" class="home-icon">
<router-link to="/opex-device-info">
<svg-icon icon-class="opex" />
</router-link>
</div>
category: {
get() {
return this.$store.state.common.category
},
set(val) {
console.log('this', this)
this.$store.commit('common/updateCategory', val)
}
},
Router–> index.js --> 路由守卫里
// 解决返回首页导航没有同步返回的情况
if (to.path === '/opex-device-info' || to.path === '/opex-supervise' || to.path === '/opex-record' || to.path === '/opex-alarm') {
store.commit('common/updateCategory', false)
} else {
store.commit('common/updateCategory', true)
}