vben
authored
|
1
|
import '/@/design/index.less';
|
vben
authored
|
2
3
4
|
import 'virtual:windi-base.css';
import 'virtual:windi-components.css';
import 'virtual:windi-utilities.css';
|
vben
authored
|
5
6
|
// Register icon sprite
import 'virtual:svg-icons-register';
|
vben
authored
|
7
|
import App from './App.vue';
|
Vben
authored
|
8
|
import { createApp } from 'vue';
|
Vben
authored
|
9
|
import { initAppConfigStore } from '/@/logics/initAppConfig';
|
vben
authored
|
10
|
import { setupErrorHandle } from '/@/logics/error-handle';
|
Vben
authored
|
11
|
import { router, setupRouter } from '/@/router';
|
Vben
authored
|
12
|
import { setupRouterGuard } from '/@/router/guard';
|
|
13
|
import { setupStore } from '/@/store';
|
vben
authored
|
14
|
import { setupGlobDirectives } from '/@/directives';
|
vben
authored
|
15
16
|
import { setupI18n } from '/@/locales/setupI18n';
import { registerGlobComp } from '/@/components/registerGlobComp';
|
vben
authored
|
17
|
|
vben
authored
|
18
|
async function bootstrap() {
|
Vben
authored
|
19
|
const app = createApp(App);
|
Vben
authored
|
20
|
|
vben
authored
|
21
|
// Configure store
|
Vben
authored
|
22
23
|
setupStore(app);
|
Vben
authored
|
24
|
// Initialize internal system configuration
|
Vben
authored
|
25
26
|
initAppConfigStore();
|
Vben
authored
|
27
28
|
// Register global components
registerGlobComp(app);
|
vben
authored
|
29
|
|
Vben
authored
|
30
|
// Multilingual configuration
|
vben
authored
|
31
|
// Asynchronous case: language files may be obtained from the server side
|
Vben
authored
|
32
33
|
await setupI18n(app);
|
Vben
authored
|
34
35
|
// Configure routing
setupRouter(app);
|
vben
authored
|
36
|
|
Vben
authored
|
37
|
// router-guard
|
vben
authored
|
38
|
setupRouterGuard(router);
|
vben
authored
|
39
|
|
Vben
authored
|
40
41
|
// Register global directive
setupGlobDirectives(app);
|
|
42
|
|
Vben
authored
|
43
44
|
// Configure global error handling
setupErrorHandle(app);
|
|
45
|
|
Vben
authored
|
46
|
// https://next.router.vuejs.org/api/#isready
|
vben
authored
|
47
|
// await router.isReady();
|
vben
authored
|
48
|
|
vben
authored
|
49
|
app.mount('#app');
|
vben
authored
|
50
51
|
}
|
vben
authored
|
52
|
bootstrap();
|