Blame view

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

import { registerGlobComp } from '/@/components/registerGlobComp';
vben authored
11
12
import { isDevMode } from '/@/utils/env';
vben authored
13
陈文彬 authored
14
15
16
17
import '/@/design/index.less';

const app = createApp(App);
vben authored
18
19
registerGlobComp(app);
20
21
// Multilingual configuration
setupI18n(app);
vben authored
22
vben authored
23
// Configure routing
陈文彬 authored
24
setupRouter(app);
vben authored
25
26

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