How to access Vuex module getters and mutations?

后端 未结 6 1250
长发绾君心
长发绾君心 2021-01-30 13:04

I\'m trying to switch to using Vuex instead of my homegrown store object, and I must say I\'m not finding the docs as clear as elsewhere in the Vue.js world. Let\'s say I have a

6条回答
  •  旧巷少年郎
    2021-01-30 13:08

    In your example it would be store.dispatch('products/clearWorkingData') you can think of actions/mutations as a file system in a way. The deeper the modules are nested the deeper in the tree they are.

    so you could go store.commit('first/second/third/method') if you had a tree that was three levels deep.

提交回复
热议问题