list.vue
<nuxt-link to="/personal/list/center" >
<p :class="page.side==1?"active":"""><i></i><b> ></b>
</nuxt-link>
in nested routing components
beforeRouteUpdate(to, from, next) {
this.set_side(3)
next()
},
mounted(){
this.set_side(3)
},
set the status of the side in the corresponding vuex
this state is not lost after the page refresh, it already exists in the localstorage
, but why is the class still not bound?
everything is fine when you jump, but something goes wrong when you refresh the page.
the data in vuex is not lost.
has no choice but to write this way.
if(that.page.side==1){
document.querySelectorAll(".left a p")[0].classList.add("active")
}