Johnhhorton
11/19/2017 - 7:29 AM

Example scaffolding for vuex modules

Example scaffolding for vuex modules

export const moduleExample = {
  namespaced: true,
  modules:{
  },
  state: {
    moduleTest: 'test'
  },
  mutations: {
    exampleMutation(state){

    }
  },
  getters: {
    exampleGetter(state, getters, rootState, rootGetters){
      console.log('hello module test')
    }
  },
  //To use root actions and commits, pass { root: true } to 3rd argument of a commit or dispatch
  actions: {
    exampleAction({ dispatch, commit, getters, rootGetters}){

    }
  },
}