vue-vben-admin/src/main.ts

65 lines
1.6 KiB
TypeScript
Raw Normal View History

2023-04-05 18:17:55 +08:00
import 'uno.css';
2023-04-06 00:08:17 +08:00
import '@/design/index.less';
import '@/components/VxeTable/src/css/index.scss';
import 'ant-design-vue/dist/antd.less';
// Register icon sprite
import 'virtual:svg-icons-register';
2023-04-06 00:08:17 +08:00
2021-06-07 21:30:27 +08:00
import { createApp } from 'vue';
2023-04-06 00:08:17 +08:00
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';
2020-10-15 21:12:38 +08:00
2021-06-01 21:30:56 +08:00
async function bootstrap() {
const app = createApp(App);
2021-04-10 19:25:49 +08:00
// Configure store
2022-05-28 05:49:18 +08:00
// 配置 store
2021-04-10 19:25:49 +08:00
setupStore(app);
2021-04-13 21:43:10 +08:00
// Initialize internal system configuration
2022-05-28 05:49:18 +08:00
// 初始化内部系统配置
initAppConfigStore();
// Register global components
2022-05-28 05:49:18 +08:00
// 注册全局组件
registerGlobComp(app);
2021-01-09 23:28:52 +08:00
2021-03-23 00:21:09 +08:00
// Multilingual configuration
2022-05-28 05:49:18 +08:00
// 多语言配置
2021-08-24 22:32:43 +08:00
// Asynchronous case: language files may be obtained from the server side
2022-05-28 05:49:18 +08:00
// 异步案例:语言文件可能从服务器端获取
2021-03-23 00:21:09 +08:00
await setupI18n(app);
// Configure routing
2022-05-28 05:49:18 +08:00
// 配置路由
setupRouter(app);
2021-01-23 21:10:00 +08:00
2021-04-10 19:25:49 +08:00
// router-guard
2022-05-28 05:49:18 +08:00
// 路由守卫
setupRouterGuard(router);
2020-11-18 22:41:59 +08:00
// Register global directive
2022-05-28 05:49:18 +08:00
// 注册全局指令
setupGlobDirectives(app);
2020-09-28 20:19:10 +08:00
// Configure global error handling
2022-05-28 05:49:18 +08:00
// 配置全局错误处理
setupErrorHandle(app);
2020-09-28 20:19:10 +08:00
2021-03-26 21:16:08 +08:00
// https://next.router.vuejs.org/api/#isready
2021-08-24 22:32:43 +08:00
// await router.isReady();
2020-10-18 21:55:21 +08:00
2021-08-24 22:41:48 +08:00
app.mount('#app');
2021-06-01 21:30:56 +08:00
}
2021-08-17 22:15:27 +08:00
bootstrap();