vue actions code example
Example 1: vuex getter root state
const getters = {
getParams: (state, getters, rootState) => {
return rootState.route.params
}
}
Example 2: vue store access state in actions
actions: {
actionName ({ commit, state }, payload) {
console.log(state)
}
}