Nuxt/test/fixtures/basic/plugins/vuex-module.js
Sébastien Chopin 6975655d78
feat: Overwrite store.registerModule (#3909)
* feat: Overwrite store.registerModule

Make `store.registerModule` works seamlessly with server-side rendering.

* fix: test failure
2018-09-18 17:21:25 +02:00

19 lines
336 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'
}
}
})
}