NEXT craftinamerica.org. Base setup for headless wordpress https://www.craftinamerica.org
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

index.js 951B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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: wp.site_name,
  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