index.js
862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import Vue from 'vue'
import Vuex from 'vuex'
import createLogger from 'vuex/dist/logger'
Vue.use(Vuex)
const state = {
ParkingTotal: 0,
orderTotal:0
}
const getters = {
getParkingTotal: function (state) {
return state.ParkingTotal
},
getOrderTotal: function (state) {
return state.orderTotal
}
}
const mutations = {
changeParkingTotal(state,str){
state.ParkingTotal = str
},
changeOrderTotal(state,str){
state.orderTotal = str
}
}
const actions = {
transferParkingTotal(context,obj){
context.commit('changeParkingTotal',obj)
},
transferOrderTotal(context,obj){
context.commit('changeOrderTotal',obj)
}
}
const debug = process.env.NODE_ENV !== 'production'
const store = new Vuex.Store({
state,
getters,
mutations,
actions,
plugins: debug ? [createLogger()] : []
})
export default store;