index.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. Vue.use(Vuex)
  4. const store = new Vuex.Store({
  5. state: {
  6. yuyueData:'',
  7. carInfo:'',
  8. ckshopInfo:'',
  9. userInfo:'',
  10. wxOpenData:'',
  11. exitNum:'',
  12. },
  13. getters:{
  14. getyuyueData(state){
  15. return state.yuyueData
  16. },
  17. getcarInfo(state){
  18. return state.carInfo
  19. },
  20. getckshopInfo(state){
  21. return state.ckshopInfo
  22. },
  23. getuserInfo(state){
  24. return state.userInfo
  25. },
  26. getwxOpenData(state){
  27. return state.wxOpenData
  28. },
  29. getexitNum(state){
  30. return state.exitNum
  31. }
  32. },
  33. mutations: {
  34. mutationsyuyueData(state,data){
  35. state.yuyueData=data
  36. },
  37. mutationscarInfo(state,data){
  38. state.carInfo=data
  39. },
  40. mutationsckshopInfo(state,data){
  41. state.ckshopInfo=data
  42. },
  43. mutationsuserInfo(state,data){
  44. state.userInfo=data
  45. },
  46. mutationswxOpenData(state,data){
  47. state.wxOpenData=data
  48. },
  49. mutationsexitNum(state,data){
  50. state.exitNum=data
  51. },
  52. },
  53. actions: {
  54. actionsyuyueData(context,playload){
  55. context.commit('mutationsyuyueData',playload)
  56. },
  57. actionscarInfo(context,playload){
  58. context.commit('mutationscarInfo',playload)
  59. },
  60. actionsckshopInfo(context,playload){
  61. context.commit('mutationsckshopInfo',playload)
  62. },
  63. actionsuserInfo(context,playload){
  64. context.commit('mutationsuserInfo',playload)
  65. },
  66. actionswxOpenData(context,playload){
  67. context.commit('mutationswxOpenData',playload)
  68. },
  69. actionsexitNum(context,playload){
  70. context.commit('mutationsexitNum',playload)
  71. },
  72. }
  73. })
  74. export default store