/**
 * vuex状态管理
 */
import Vue from 'vue';
import Vuex from 'vuex';
import getters from './getters';
import dict from './modules/dict';
import user from './modules/user';
import theme from './modules/theme';
import createPersistedState from 'vuex-persistedstate';
import userPageModule from './modules/userPage'; // 引入用户列表模块

Vue.use(Vuex);

export default new Vuex.Store({
  state: {},
  mutations: {},
  actions: {},
  modules: {
    dict,
    user,
    theme,
    userPage: userPageModule
  },
  getters,
  plugins: [
    createPersistedState({
      key: 'vuex-wms',
      storage: window.sessionStorage,
      paths: ['user']
    })
  ] //会自动保存创建的状态。刷新还在
});
