You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

23 lines
494 B

import Vue from 'vue'
import Vuex from "vuex";
// 引入状态机 使用状态机
Vue.use(Vuex)
import createPersistedState from "vuex-persistedstate";
// 用了一个模块化 来获取token
import moduleAuth from './module/auth.js';
import {
localStorage
} from "mp-storage"
export default new Vuex.Store({
state: {},
mutations: {},
actions: {},
modules: {
moduleAuth
},
// 数据持久化 会默认储存到本地
plugins: [createPersistedState({
storage: localStorage
})]
});