无木
2021-06-04 fb6c76db535bd0c6305d03c0cff876a1f079100b
提交 | 用户 | age
4d7001 1 import '/@/design/index.less';
d73d43 2
V 3 // Register windi
26adbc 4 import 'virtual:windi.css';
d73d43 5 // Register icon sprite
V 6 import 'virtual:svg-icons-register';
4d7001 7
2f6253 8 import { createApp } from 'vue';
73c8e0 9 import App from './App.vue';
26adbc 10 import { initAppConfigStore } from '/@/logics/initAppConfig';
d73d43 11 import { setupErrorHandle } from '/@/logics/error-handle';
2f6253 12 import router, { setupRouter } from '/@/router';
215d8b 13 import { setupRouterGuard } from '/@/router/guard';
2f6253 14 import { setupStore } from '/@/store';
2e79c9 15 import { setupGlobDirectives } from '/@/directives';
99ac30 16 import { setupI18n } from '/@/locales/setupI18n';
V 17 import { registerGlobComp } from '/@/components/registerGlobComp';
9c2a2a 18
566280 19 // Do not introduce on-demand in local development?
V 20 // In the local development for introduce on-demand, the number of browser requests will increase by about 20%.
ee4829 21 // Which may slow down the browser refresh.
V 22 // Therefore, all are introduced in local development, and only introduced on demand in the production environment
23 if (import.meta.env.DEV) {
24   import('ant-design-vue/dist/antd.less');
25 }
26
8a3f47 27 async function bootstrap() {
f6cef1 28   const app = createApp(App);
215d8b 29
d5b768 30   // Configure store
215d8b 31   setupStore(app);
V 32
2cdf2c 33   // Initialize internal system configuration
26adbc 34   initAppConfigStore();
V 35
f6cef1 36   // Register global components
V 37   registerGlobComp(app);
46e087 38
fedd9c 39   // Multilingual configuration
V 40   await setupI18n(app);
41
f6cef1 42   // Configure routing
V 43   setupRouter(app);
f24422 44
215d8b 45   // router-guard
V 46   setupRouterGuard();
46e087 47
f6cef1 48   // Register global directive
V 49   setupGlobDirectives(app);
2f6253 50
f6cef1 51   // Configure global error handling
V 52   setupErrorHandle(app);
2f6253 53
d5d4c4 54   // Mount when the route is ready
e09068 55   // https://next.router.vuejs.org/api/#isready
fedd9c 56   await router.isReady();
710158 57
bd7b53 58   app.mount('#app', true);
8a3f47 59 }
V 60
61 void bootstrap();