Blame view

src/main.ts 1.68 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
import 'ant-design-vue/dist/antd.css';
7
8
// Register icon sprite
import 'virtual:svg-icons-register';
vben authored
9
import App from './App.vue';
Vben authored
10
import { createApp } from 'vue';
11
import { initAppConfigStore } from '/@/logics/initAppConfig';
12
import { setupErrorHandle } from '/@/logics/error-handle';
Vben authored
13
import { router, setupRouter } from '/@/router';
Vben authored
14
import { setupRouterGuard } from '/@/router/guard';
陈文彬 authored
15
import { setupStore } from '/@/store';
vben authored
16
import { setupGlobDirectives } from '/@/directives';
vben authored
17
18
import { setupI18n } from '/@/locales/setupI18n';
import { registerGlobComp } from '/@/components/registerGlobComp';
vben authored
19
vben authored
20
async function bootstrap() {
21
  const app = createApp(App);
Vben authored
22
23
  // Configure store
Jim authored
24
  // 配置 store
Vben authored
25
26
  setupStore(app);
27
  // Initialize internal system configuration
Jim authored
28
  // 初始化内部系统配置
29
30
  initAppConfigStore();
31
  // Register global components
Jim authored
32
  // 注册全局组件
33
  registerGlobComp(app);
vben authored
34
Vben authored
35
  // Multilingual configuration
Jim authored
36
  // 多语言配置
37
  // Asynchronous case: language files may be obtained from the server side
Jim authored
38
  // 异步案例:语言文件可能从服务器端获取
Vben authored
39
40
  await setupI18n(app);
41
  // Configure routing
Jim authored
42
  // 配置路由
43
  setupRouter(app);
vben authored
44
Vben authored
45
  // router-guard
Jim authored
46
  // 路由守卫
47
  setupRouterGuard(router);
vben authored
48
49
  // Register global directive
Jim authored
50
  // 注册全局指令
51
  setupGlobDirectives(app);
陈文彬 authored
52
53
  // Configure global error handling
Jim authored
54
  // 配置全局错误处理
55
  setupErrorHandle(app);
陈文彬 authored
56
Vben authored
57
  // https://next.router.vuejs.org/api/#isready
58
  // await router.isReady();
vben authored
59
vben authored
60
  app.mount('#app');
vben authored
61
62
}
vben authored
63
bootstrap();