index.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. },
  12. getters:{
  13. getyuyueData(state){
  14. return state.yuyueData
  15. },
  16. getcarInfo(state){
  17. return state.carInfo
  18. },
  19. getckshopInfo(state){
  20. return state.ckshopInfo
  21. },
  22. getuserInfo(state){
  23. return state.userInfo
  24. },
  25. getwxOpenData(state){
  26. return state.wxOpenData
  27. }
  28. },
  29. mutations: {
  30. mutationsyuyueData(state,data){
  31. state.yuyueData=data
  32. },
  33. mutationscarInfo(state,data){
  34. state.carInfo=data
  35. },
  36. mutationsckshopInfo(state,data){
  37. state.ckshopInfo=data
  38. },
  39. mutationsuserInfo(state,data){
  40. state.userInfo=data
  41. },
  42. mutationswxOpenData(state,data){
  43. state.wxOpenData=data
  44. },
  45. },
  46. actions: {
  47. actionsyuyueData(context,playload){
  48. context.commit('mutationsyuyueData',playload)
  49. },
  50. actionscarInfo(context,playload){
  51. context.commit('mutationscarInfo',playload)
  52. },
  53. actionsckshopInfo(context,playload){
  54. context.commit('mutationsckshopInfo',playload)
  55. },
  56. actionsuserInfo(context,playload){
  57. context.commit('mutationsuserInfo',playload)
  58. },
  59. actionswxOpenData(context,playload){
  60. context.commit('mutationswxOpenData',playload)
  61. },
  62. }
  63. })
  64. export default store