mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-24 22:55:13 +00:00
28 lines
496 B
JavaScript
28 lines
496 B
JavaScript
export default function ({ store }) {
|
|
store.registerModule('simpleModule', {
|
|
namespaced: true,
|
|
state: () => ({
|
|
mutateMe: 'not mutated'
|
|
}),
|
|
actions: {
|
|
mutate ({ commit }) {
|
|
commit('mutate')
|
|
}
|
|
},
|
|
mutations: {
|
|
mutate (state) {
|
|
state.mutateMe = 'mutated'
|
|
}
|
|
}
|
|
})
|
|
|
|
if (process.server) { return }
|
|
|
|
store.registerModule('clientsideModule', {
|
|
namespaced: true,
|
|
state: () => ({
|
|
initialised: true
|
|
})
|
|
})
|
|
}
|