index.js 639 B

1234567891011121314151617181920212223242526272829303132333435
  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. },
  9. getters:{
  10. getyuyueData(state){
  11. return state.yuyueData
  12. },
  13. getcarInfo(state){
  14. return state.carInfo
  15. },
  16. },
  17. mutations: {
  18. mutationsyuyueData(state,data){
  19. state.yuyueData=data
  20. },
  21. mutationscarInfo(state,data){
  22. state.carInfo=data
  23. },
  24. },
  25. actions: {
  26. actionsyuyueData(context,playload){
  27. context.commit('mutationsyuyueData',playload)
  28. },
  29. actionscarInfo(context,playload){
  30. context.commit('mutationscarInfo',playload)
  31. },
  32. }
  33. })
  34. export default store