Blame view

src/store/store.js 691 Bytes
35b48aa6   liuqimichale   init
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
  import Vue from 'vue'
  import Vuex from 'vuex'
  
  Vue.use(Vuex)
  
  const state = {
    showFlag: true,
    payFlag: false
  }
  
  const getters = {
    _getshowflag: state => state.showFlag,
    _getPayFlag: state => state.payFlag
  }
  
  const mutations = {
    handleShow: state => {
      state.showFlag = true
    },
    handleHide: state => {
      state.showFlag = false
    },
    handlePayFlag: state => {
      state.payFlag = true
    }
  }
  
  const actions = {
    handleShow: ({ commit }) => commit('handleShow'),
    handleHide: ({ commit }) => commit('handleHide'),
    handlePayFlag: ({ commit }) => commit('handlePayFlag')
  }
  
  const store = new Vuex.Store({
    state,
    getters,
    mutations,
    actions
  })
  
  export default store