📜  vuex access getter in mutatuons - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:57.604000             🧑  作者: Mango

代码示例1
//  Vuex store mutation methods do not provide direct access to getters.


actions: {
  fooAction({commit, getters}, data) {
    commit('FOO_MUTATION', {data, getters})
  }
},
mutations: {
  FOO_MUTATION(state, {data, getters}) {
    console.log(getters);
  }
}