index.js 632 字节
Newer Older
yma16's avatar
yma16 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
import Vue from 'vue'
import Vuex from 'vuex'
import user from './modules/user'
import persistedstate from "vuex-persistedstate";

// import createLogger from '../../../src/plugins/logger' 

Vue.use(Vuex)
const debug = process.env.NODE_ENV !== 'production'
let files = require.context("./modules", false, /\.js$/);
let modules = {};
files.keys().map((key) => {
    modules[key.replace(/(\.\/|\.js)/g, "")] = files(key).default;
});

export default new Vuex.Store({
    plugins: [
        persistedstate({
            key: "VBI",
        }),
    ],
    modules,
    strict: debug
        // plugins: debug ? [createLogger()] : []
});