原文:在vue組件中訪問vuex模塊中的getters/action/state

store的結構: city模塊: 在各模塊使用了命名空間的情況下,即namespaced: true時: 組件中訪問模塊里的state 傳統方法: 例如:this. store.state.city.list。 控制台輸出this. store.state mapState方法: 組件中dispatch模塊里的actions 傳統方法: 組件中使用如:this. store.dispatch c ...

2021-03-15 18:17 0 478 推薦指數:

查看詳情

vue組件訪問vuex模塊getters/action/state

store的結構: city模塊: 在各模塊使用了命名空間的情況下,即 namespaced: true 時: 組件訪問模塊里的state 傳統方法: 例如:this.$store.state.city.list。 控制台輸出 this. ...

Thu Nov 14 08:01:00 CST 2019 0 2622
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM