Blame view

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

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