index.ts 461 字节
Newer Older
陈文彬 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
import type { App } from 'vue';
import { createStore, createLogger, Plugin } from 'vuex';
import { config } from 'vuex-module-decorators';
import { isDevMode } from '/@/utils/env';

config.rawError = true;
const isDev = isDevMode();
const plugins: Plugin<any>[] = isDev ? [createLogger()] : [];

const store = createStore({
  modules: {},
  strict: isDev,
  plugins,
});
export function setupStore(app: App<Element>) {
  app.use(store);
}
export default store;