Use 2 files for normal store

This commit is contained in:
Sébastien Chopin 2017-05-21 02:03:11 +02:00
parent b68033a3b8
commit e95c0a6573
2 changed files with 18 additions and 11 deletions

View File

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

View File

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