Nuxt/test/fixtures/basic/plugins/vuex-module.js

19 lines
336 B
JavaScript
Raw Normal View History

export default function ({ store }) {
store.registerModule('simpleModule', {
namespaced: true,
state: () => ({
mutateMe: 'not mutated'
}),
actions: {
mutate({ commit }) {
commit('mutate')
}
},
mutations: {
mutate(state) {
state.mutateMe = 'mutated'
}
}
})
}