I have a vuex file with a growing mass of mutators, but I\'m not sure of the correct way of splitting it out into different files.
Because I have:
cons
In addition to @bigsee's fine answer, if using an index.js file to export the module:
└── src
├── assets
├── components
└── store
└─ mymodule
├── state.js
├── actions.js
├── mutations.js
├── getters.js
└── index.js
import state from './state'
import * as getters from './getters'
import * as mutations from './mutations'
import * as actions from './actions'
export default {
state,
getters,
mutations,
actions
}
const getData = state => state.data
export {
getData
}
Similar with actions, mutations and state files.