Blame view

src/main.ts 1.69 KB
1
2
import 'virtual:windi-base.css';
import 'virtual:windi-components.css';
3
import '/@/design/index.less';
4
import 'virtual:windi-utilities.css';
5
6
// Register icon sprite
import 'virtual:svg-icons-register';
vben authored
7
import App from './App.vue';
Vben authored
8
import { createApp } from 'vue';
9
import { initAppConfigStore } from '/@/logics/initAppConfig';
10
import { setupErrorHandle } from '/@/logics/error-handle';
Vben authored
11
import { router, setupRouter } from '/@/router';
Vben authored
12
import { setupRouterGuard } from '/@/router/guard';
陈文彬 authored
13
import { setupStore } from '/@/store';
vben authored
14
import { setupGlobDirectives } from '/@/directives';
vben authored
15
16
import { setupI18n } from '/@/locales/setupI18n';
import { registerGlobComp } from '/@/components/registerGlobComp';
vben authored
17
18
19
20
21
22
23
import { isDevMode } from './utils/env';

if (isDevMode()) {
  import('ant-design-vue/es/style');
}
vben authored
24
async function bootstrap() {
25
  const app = createApp(App);
Vben authored
26
27
  // Configure store
Jim authored
28
  // 配置 store
Vben authored
29
30
  setupStore(app);
31
  // Initialize internal system configuration
Jim authored
32
  // 初始化内部系统配置
33
34
  initAppConfigStore();
35
  // Register global components
Jim authored
36
  // 注册全局组件
37
  registerGlobComp(app);
vben authored
38
Vben authored
39
  // Multilingual configuration
Jim authored
40
  // 多语言配置
41
  // Asynchronous case: language files may be obtained from the server side
Jim authored
42
  // 异步案例:语言文件可能从服务器端获取
Vben authored
43
44
  await setupI18n(app);
45
  // Configure routing
Jim authored
46
  // 配置路由
47
  setupRouter(app);
vben authored
48
Vben authored
49
  // router-guard
Jim authored
50
  // 路由守卫
51
  setupRouterGuard(router);
vben authored
52
53
  // Register global directive
Jim authored
54
  // 注册全局指令
55
  setupGlobDirectives(app);
陈文彬 authored
56
57
  // Configure global error handling
Jim authored
58
  // 配置全局错误处理
59
  setupErrorHandle(app);
陈文彬 authored
60
Vben authored
61
  // https://next.router.vuejs.org/api/#isready
62
  // await router.isReady();
vben authored
63
vben authored
64
  app.mount('#app');
vben authored
65
66
}
vben authored
67
bootstrap();