index.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // import Vue from 'vue'
  2. // import Vuex from 'vuex'
  3. import axios from 'axios'
  4. // Vue.use(Vuex)
  5. export const state = () => ({
  6. newsNav: [
  7. {
  8. icon: require('~/assets/images/news/cate_01.png'),
  9. title: '中德资讯',
  10. id: 1
  11. },
  12. {
  13. icon: require('~/assets/images/news/cate_02.png'),
  14. title: '行业动态',
  15. id: 2
  16. },
  17. {
  18. icon: require('~/assets/images/news/cate_03.png'),
  19. title: '门店动态',
  20. id: 3
  21. }
  22. ],
  23. })
  24. export const mutations = {
  25. setNav(state, data){
  26. state.newsNav = data
  27. },
  28. };
  29. export const getters = {
  30. };
  31. export const actions = {
  32. async nuxtServerInit({commit,state,req}) {
  33. // //产品导航
  34. // let headProdNav = await axios(`${state.wordpressAPI}/proCategory/showAll/main`);
  35. // commit('setHeadProdNav',headProdNav.data);
  36. // //新闻导航
  37. // let headNewsNav = await axios(`${state.wordpressAPI}/articleCategory/getAll`);
  38. // commit('setHeadNewsNav',headNewsNav.data);
  39. // //招聘导航
  40. // let headJobNav = await axios(`${state.wordpressAPIForJob}/jobClass/getAll`);
  41. // commit('setHeadJobNav',headJobNav.data);
  42. // //友情链接
  43. // let indexLinksData = await axios(`${state.wordpressAPI}/link/selectAll`);
  44. // commit('setIndexLinksData',indexLinksData.data);
  45. }
  46. };
  47. // export default {
  48. // state,
  49. // getters,
  50. // mutations,
  51. // actions
  52. // }
  53. // const store = () => new Vuex.Store({
  54. // state,
  55. // getters,
  56. // mutations,
  57. // actions
  58. // })
  59. // export default store