无木
2021-09-15 ba2c1a3bf5f6d83ce37dd3bd9a1ff263ac02fc44
提交 | 用户 | age
4d7001 1 import '/@/design/index.less';
9dd9fc 2 import 'virtual:windi-base.css';
V 3 import 'virtual:windi-components.css';
4 import 'virtual:windi-utilities.css';
d73d43 5 // Register icon sprite
V 6 import 'virtual:svg-icons-register';
73c8e0 7 import App from './App.vue';
cda0f9 8 import { createApp } from 'vue';
26adbc 9 import { initAppConfigStore } from '/@/logics/initAppConfig';
d73d43 10 import { setupErrorHandle } from '/@/logics/error-handle';
cda0f9 11 import { router, setupRouter } from '/@/router';
215d8b 12 import { setupRouterGuard } from '/@/router/guard';
2f6253 13 import { setupStore } from '/@/store';
2e79c9 14 import { setupGlobDirectives } from '/@/directives';
99ac30 15 import { setupI18n } from '/@/locales/setupI18n';
V 16 import { registerGlobComp } from '/@/components/registerGlobComp';
9c2a2a 17
2884e8 18 // Importing on demand in local development will increase the number of browser requests by around 20%.
V 19 // This may slow down the browser refresh speed.
20 // Therefore, only enable on-demand importing in production environments .
ee4829 21 if (import.meta.env.DEV) {
V 22   import('ant-design-vue/dist/antd.less');
23 }
24
8a3f47 25 async function bootstrap() {
f6cef1 26   const app = createApp(App);
215d8b 27
d5b768 28   // Configure store
215d8b 29   setupStore(app);
V 30
2cdf2c 31   // Initialize internal system configuration
26adbc 32   initAppConfigStore();
V 33
f6cef1 34   // Register global components
V 35   registerGlobComp(app);
46e087 36
fedd9c 37   // Multilingual configuration
2884e8 38   // Asynchronous case: language files may be obtained from the server side
fedd9c 39   await setupI18n(app);
V 40
f6cef1 41   // Configure routing
V 42   setupRouter(app);
f24422 43
215d8b 44   // router-guard
327d71 45   setupRouterGuard(router);
46e087 46
f6cef1 47   // Register global directive
V 48   setupGlobDirectives(app);
2f6253 49
f6cef1 50   // Configure global error handling
V 51   setupErrorHandle(app);
2f6253 52
e09068 53   // https://next.router.vuejs.org/api/#isready
2884e8 54   // await router.isReady();
710158 55
56a966 56   app.mount('#app');
8a3f47 57 }
V 58
657359 59 bootstrap();