this.$store.commit('update',['language','zh-CN'])
更新了state值,当前页打印时,值变了
console.log(this.$store.state.language),打印也是正确的更新之后的值
但是别的页面的这个值没有更新this.$store.state.language
this.$store.commit('update',['language','zh-CN'])
更新了state值,当前页打印时,值变了
console.log(this.$store.state.language),打印也是正确的更新之后的值
但是别的页面的这个值没有更新this.$store.state.language
你取值页面是怎么用的,需要用mapState放在computed里面的方式使用才行,如果直接‘=this.$store.state.xxx’ 方式的话要重新取一遍值