如題,因為我在組件create里面獲取不到值,請問怎么才能獲取更新后的vuex state值this.$store.dispatch('setText','jj');
console.log(this.$store.state.text);//這里打印的是jjconst store = new Vuex.Store({ state:{
wxInfo:{},
text:'ss'
},
...computed:{
...mapState([
'wxInfo',
'text'
])
},created(){
console.log(this.text)//但是在組件這里打印的卻是 ss
...
添加回答
舉報
0/150
提交
取消