NEXT craftinamerica.org. Base setup for headless wordpress https://www.craftinamerica.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 946B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // SHAMELESS THEFT: https://github.com/EvanAgee/vuejs-wordpress-theme-starter
  2. import Vuex from 'vuex'
  3. import * as actions from './actions'
  4. import * as getters from './getters'
  5. import page from './modules/page'
  6. import post from './modules/post'
  7. import artist from './modules/artist'
  8. import episode from './modules/episode'
  9. const debug = process.env.NODE_ENV !== 'production'
  10. // Vue.config.devtools = true
  11. // Current page state
  12. const state = {
  13. title: 'Test',
  14. hero: {
  15. url: 'http://sample-image-url/',
  16. text: 'sample hero text',
  17. playbutton: true
  18. },
  19. view: 'list'
  20. }
  21. const mutations = {
  22. SET_HERO(state, hero) {
  23. if (hero.url) {
  24. state.hero.text = state.hero.url = hero.url
  25. } else {
  26. state.hero.text = hero
  27. }
  28. },
  29. }
  30. const store = new Vuex.Store({
  31. actions,
  32. getters,
  33. mutations,
  34. state,
  35. modules: {
  36. post,
  37. page,
  38. artist,
  39. episode
  40. },
  41. strict: debug,
  42. })
  43. export default store