Vuex 分為兩種:
1.commit 同步存儲
this.$store.commit('newBankName',name) // 同步存儲
this.$store.state.changeValue // 取值
同步存儲沒什么好解釋的,正常存儲,動態(tài)改變值一般用異步存儲,同步和異步最大的區(qū)別是同步會在頁面執(zhí)行之后,異步會在頁面之前調(diào)用
2.dispatch: 異步存儲
存儲 this.$store.dispatch('newBankName',name)
取值 this.$store.getters.getlists
例:我這里用的是ElementUi組件
this.$store.dispatch('user/newBankName', this.downlists) // 儲存一個叫 downlists 的對象 儲存的地方為 store下modules的user目錄下,當(dāng)然你也可以選擇其他目錄方法一樣
如圖:

image.png
然后找到 getters.js 文件

image.png
聲明一遍 這樣就可以了。
不對的地方還請多多包涵,這只是個人理解,僅此記錄。