import Vue from 'vue' import axios from 'axios' import Vuex from 'vuex' Vue.use(Vuex) // const homePath = window.sessionStorage.getItem('homePath') || '/index/home'; const activePath = window.sessionStorage.getItem('activePath') || '/index/home'; const state = { // homePath:homePath, activePath:activePath, //激活的菜单项 // baseLandList:[] // skin:'custom-ffffff' } const mutations = { changeHomePath(state,payload){ var _state = state; var _payload = payload; _state.homePath = _payload.homePath; window.sessionStorage.setItem('activePath',_payload.homePath) // setTimeout(function(){ console.log(_state) console.log(_payload) _state.activePath = _payload.homePath; window.sessionStorage.setItem('homePath',_payload.homePath) // },4000) }, saveActiveState(state,payload){ state.activePath = payload.activePath; window.sessionStorage.setItem('activePath',payload.activePath) }, } export default new Vuex.Store({ state, mutations, })