index.js 663 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. Vue.use(Vuex)
  4. const store = new Vuex.Store({
  5. state: {
  6. couponstate:true,
  7. shareID:'',
  8. },
  9. getters:{
  10. getcouponstate(state){
  11. return state.couponstate
  12. },
  13. getshareID(state){
  14. return state.shareID
  15. },
  16. },
  17. mutations: {
  18. mutationscouponstate(state,data){
  19. state.couponstate=data
  20. },
  21. mutationsshareID(state,data){
  22. state.shareID=data
  23. },
  24. },
  25. actions: {
  26. actionscouponstate(context,playload){
  27. context.commit('mutationscouponstate',playload)
  28. },
  29. actionsshareID(context,playload){
  30. context.commit('mutationsshareID',playload)
  31. },
  32. }
  33. })
  34. export default store