mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 09:34:19 +08:00
refactor: refactor store
This commit is contained in:
12
src/main.ts
12
src/main.ts
@@ -5,15 +5,13 @@ import { createApp } from 'vue';
|
||||
import App from './App.vue';
|
||||
|
||||
import router, { setupRouter } from '/@/router';
|
||||
import { setupRouterGuard } from '/@/router/guard';
|
||||
import { setupStore } from '/@/store';
|
||||
import { setupErrorHandle } from '/@/logics/error-handle';
|
||||
import { setupGlobDirectives } from '/@/directives';
|
||||
import { setupI18n } from '/@/locales/setupI18n';
|
||||
import { registerGlobComp } from '/@/components/registerGlobComp';
|
||||
|
||||
// router-guard
|
||||
import '/@/router/guard';
|
||||
|
||||
// Register icon Sprite
|
||||
import 'vite-plugin-svg-icons/register';
|
||||
|
||||
@@ -27,6 +25,10 @@ if (import.meta.env.DEV) {
|
||||
|
||||
(async () => {
|
||||
const app = createApp(App);
|
||||
|
||||
// Configure vuex store
|
||||
setupStore(app);
|
||||
|
||||
// Register global components
|
||||
registerGlobComp(app);
|
||||
|
||||
@@ -36,8 +38,8 @@ if (import.meta.env.DEV) {
|
||||
// Configure routing
|
||||
setupRouter(app);
|
||||
|
||||
// Configure vuex store
|
||||
setupStore(app);
|
||||
// router-guard
|
||||
setupRouterGuard();
|
||||
|
||||
// Register global directive
|
||||
setupGlobDirectives(app);
|
||||
|
Reference in New Issue
Block a user