station.js 518 B

1234567891011121314151617181920212223242526272829303132
  1. const state = {
  2. station: {},
  3. editing: {}
  4. };
  5. const getters = {};
  6. const actions = {
  7. joinStation: ({ commit }, station) => {
  8. commit("joinStation", station);
  9. },
  10. editStation: ({ commit }, station) => {
  11. commit("editStation", station);
  12. }
  13. };
  14. const mutations = {
  15. joinStation(state, station) {
  16. state.station = { ...station };
  17. },
  18. editStation(state, station) {
  19. state.editing = { ...station };
  20. }
  21. };
  22. export default {
  23. namespaced: true,
  24. state,
  25. getters,
  26. actions,
  27. mutations
  28. };