// import Vue from 'vue' // import Vuex from 'vuex' import axios from 'axios' // Vue.use(Vuex) export const state = () => ({ wordpressAPI: 'https://open.zaojiao.net', newsNav: [ { icon: require('~/assets/images/news/cate_01.png'), title: '中德资讯', id: 1 }, { icon: require('~/assets/images/news/cate_02.png'), title: '行业动态', id: 2 }, { icon: require('~/assets/images/news/cate_03.png'), title: '门店动态', id: 3 } ], }) export const mutations = { setNav(state, data){ state.newsNav = data }, }; export const getters = { }; export const actions = { async nuxtServerInit({commit,state,req}) { // //产品导航 // let headProdNav = await axios(`${state.wordpressAPI}/proCategory/showAll/main`); // commit('setHeadProdNav',headProdNav.data); // //新闻导航 // let headNewsNav = await axios(`${state.wordpressAPI}/articleCategory/getAll`); // commit('setHeadNewsNav',headNewsNav.data); // //招聘导航 // let headJobNav = await axios(`${state.wordpressAPIForJob}/jobClass/getAll`); // commit('setHeadJobNav',headJobNav.data); // //友情链接 // let indexLinksData = await axios(`${state.wordpressAPI}/link/selectAll`); // commit('setIndexLinksData',indexLinksData.data); } }; // export default { // state, // getters, // mutations, // actions // } // const store = () => new Vuex.Store({ // state, // getters, // mutations, // actions // }) // export default store