代码语言:javascript复制store.js 状态汇总文件 暴露
import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate' //存储插件
import actions from './store/actions'
import mutations from './store/mutations'
import state from './store/state'
import meModule from './store/me_module'
Vue.use(Vuex)
const getters = {
}
const store = new Vuex.Store({
state : {
...state
},
mutations : {
...mutations
},
actions : {
...actions
},
getters,
modules:{
me:meModule
},
plugins:[createPersistedState({ storage: window.sessionStorage })]
})
export default store;