store.js 691 Bytes
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