I have an action in a module with names and a global mutation (i.e. not in a module). I would like to be able to capture a global mutation within an action.
export default {
globalMutation (state, payload) {
...
}
}
export default {
namespaced: true,
actions: {
namespacedAction ({ commit, dispatch, state }, payload) {
commit({ type: 'globalMutation' })
}
}
}
When an action with names is dispatched, Vuex displays:
[vuex] unknown local mutation type: globalMutation, global type: module/globalMutation
Is there an option that I can pass functions committo call this global mutation?
source
share