Blame view

src/main.ts 1.65 KB
vben authored
1
import 'uno.css';
vben authored
2
3
import '@/design/index.less';
import '@/components/VxeTable/src/css/index.scss';
4
import 'ant-design-vue/dist/antd.less';
5
6
// Register icon sprite
import 'virtual:svg-icons-register';
vben authored
7
Vben authored
8
import { createApp } from 'vue';
vben authored
9
10
11
12
13
14
15
16
17
18
19

import { registerGlobComp } from '@/components/registerGlobComp';
import { setupGlobDirectives } from '@/directives';
import { setupI18n } from '@/locales/setupI18n';
import { setupErrorHandle } from '@/logics/error-handle';
import { initAppConfigStore } from '@/logics/initAppConfig';
import { router, setupRouter } from '@/router';
import { setupRouterGuard } from '@/router/guard';
import { setupStore } from '@/store';

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