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'
const store = new Vuex.Store({
state: {
counter: 0
},
mutations: {
increment (state) {
state.counter++
}
}
})
import mutations from './mutations'
export default store
const createStore = () => {
return new Vuex.Store({
state: {
counter: 0
},
mutations
})
}
export default createStore

View File

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