mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-26 16:46:19 +08:00
21 lines
466 B
TypeScript
21 lines
466 B
TypeScript
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;
|