Blame view

src/store/index.js 636 Bytes
22fb20b3   songchongxian   城市停车运营监控
1
2
  import Vue from 'vue'
  import Vuex from 'vuex'
a1bafdec   liuqimichale   vuex
3
4
  
  import createLogger from 'vuex/dist/logger'
22fb20b3   songchongxian   城市停车运营监控
5
6
7
  
  Vue.use(Vuex)
  
a1bafdec   liuqimichale   vuex
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
  const state = {
    ParkingTotal: 10000
  
  }
  
  const getters = {
    getParkingTotal: function (state) {
      return state.ParkingTotal
    }
  }
  
  const mutations = {
    changeParkingTotal(state,str){
      state.ParkingTotal = str
    }
  
  }
  
  const actions = {
    transferParkingTotal(context,obj){
      context.commit('changeParkingTotal',obj)
    }
  }
  
  
  const debug = process.env.NODE_ENV !== 'production'
22fb20b3   songchongxian   城市停车运营监控
34
  
a1bafdec   liuqimichale   vuex
35
36
37
38
39
40
  const store = new Vuex.Store({
    state,
    getters,
    mutations,
    actions,
    plugins: debug ? [createLogger()] : []
22fb20b3   songchongxian   城市停车运营监控
41
  })
a1bafdec   liuqimichale   vuex
42
  export  default  store;