example(vuex-store): change to module store (#4923)

This commit is contained in:
Alexander Lichter 2019-02-01 13:02:41 +00:00 committed by Pooya Parsa
parent f70645e5aa
commit be41ae1c2f
2 changed files with 7 additions and 19 deletions

View File

@ -1,14 +1,9 @@
import Vuex from 'vuex'
export const state = () => ({
counter: 0
})
import mutations from './mutations'
const createStore = () => {
return new Vuex.Store({
state: {
counter: 0
},
mutations
})
export const mutations = {
increment(state) {
state.counter++
}
}
export default createStore

View File

@ -1,7 +0,0 @@
const mutations = {
increment(state) {
state.counter++
}
}
export default mutations