2020-07-15 09:38:41 +00:00
|
|
|
import Vue from 'vue'
|
|
|
|
import Vuex from 'vuex'
|
|
|
|
Vue.use(Vuex)
|
|
|
|
|
|
|
|
const store = new Vuex.Store({
|
|
|
|
state: {
|
2020-07-15 08:21:43 +00:00
|
|
|
count: 0
|
|
|
|
},
|
|
|
|
getters: {
|
|
|
|
doubleCount (state) {
|
|
|
|
return state.count * 2
|
|
|
|
}
|
2020-07-15 09:38:41 +00:00
|
|
|
},
|
2020-07-15 08:21:43 +00:00
|
|
|
mutations: {
|
|
|
|
increment (state) {
|
|
|
|
state.count++
|
|
|
|
}
|
|
|
|
}
|
2020-07-15 09:38:41 +00:00
|
|
|
})
|
|
|
|
export default store;
|