common.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // import REST from 'vuejs/api/rest-axios'
  2. // import JSONAPI from 'vuejs/api/json-axios'
  3. // import qs from 'querystring-es3'
  4. export default {
  5. namespaced: true,
  6. // initial state
  7. state: {
  8. pagetitle: null,
  9. hamburgerMenuToggle: document.querySelector('input#header-block-right-toggle'),
  10. coolLightBoxItems: null,
  11. coolLightBoxIndex: null
  12. },
  13. // getters
  14. getters: {},
  15. // mutations
  16. mutations: {
  17. setPagetitle (state, title) {
  18. console.log('Common, setPagetitle', title)
  19. state.pagetitle = title
  20. },
  21. setHamMenuState (state, s) {
  22. state.hamburgerMenuToggle.checked = s
  23. },
  24. setcoolLightBoxItems (state, items) {
  25. state.coolLightBoxItems = items
  26. },
  27. setcoolLightBoxIndex (state, i) {
  28. state.coolLightBoxIndex = i
  29. }
  30. },
  31. // actions
  32. actions: {
  33. openCloseHamMenu ({ dispatch, commit, state }, s) {
  34. console.log('openCloseHamMenu', s)
  35. commit('setHamMenuState', s)
  36. },
  37. setcoolLightBoxIndex ({ dispatch, commit, state }, i) {
  38. console.log('setcoolLightBoxIndex', i)
  39. commit('setcoolLightBoxIndex', i)
  40. },
  41. setcoolLightBoxItems ({ dispatch, commit, state }, items) {
  42. console.log('setcoolLightBoxItems', items)
  43. commit('setcoolLightBoxItems', items)
  44. }
  45. }
  46. }