可能因为格式的问题,无法再组件里面直接监听全局变量,通过compute属性来更新
computed: {
listenshowpage1() {
return this.$store.state.topath;
}
},
watch:{
listenshowpage1:function(old,newd){
console.log(old)
this.temp = old;
}
}