index.js 862 Bytes
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;