Blame view

src/main.ts 991 Bytes
vben authored
1
2
3
import '/@/design/index.less';
import 'windi.css';
陈文彬 authored
4
import { createApp } from 'vue';
vben authored
5
import App from './App.vue';
vben authored
6
陈文彬 authored
7
8
import router, { setupRouter } from '/@/router';
import { setupStore } from '/@/store';
vben authored
9
import { setupErrorHandle } from '/@/logics/error-handle';
vben authored
10
import { setupGlobDirectives } from '/@/directives';
vben authored
11
12
13
import { setupI18n } from '/@/locales/setupI18n';

import { registerGlobComp } from '/@/components/registerGlobComp';
vben authored
14
15
import { isDevMode } from '/@/utils/env';
vben authored
16
陈文彬 authored
17
18
const app = createApp(App);
vben authored
19
20
registerGlobComp(app);
21
22
// Multilingual configuration
setupI18n(app);
vben authored
23
vben authored
24
// Configure routing
陈文彬 authored
25
setupRouter(app);
vben authored
26
27

// Configure vuex store
陈文彬 authored
28
29
setupStore(app);
vben authored
30
31
// Register global directive
setupGlobDirectives(app);
陈文彬 authored
32
vben authored
33
// Configure global error handling
vben authored
34
35
setupErrorHandle(app);
vben authored
36
// Mount when the route is ready
陈文彬 authored
37
router.isReady().then(() => {
38
  app.mount('#app', true);
陈文彬 authored
39
40
});
vben authored
41
// The development environment takes effect
陈文彬 authored
42
43
44
45
if (isDevMode()) {
  app.config.performance = true;
  window.__APP__ = app;
}