123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- import 'uno.css';
- import '/@/design/index.less';
- import animate from 'animate.css';
- //lxh
- import './assets/iconfong/iconfont.css';
- import './assets/iconfong/iconfont.js';
- // 注册图标
- import 'virtual:svg-icons-register';
- import App from './App.vue';
- import { createApp } from 'vue';
- import { getRemoteSetting } from '/@/hooks/setting';
- import { initAppConfigStore } from '/@/logics/initAppConfig';
- import { setupErrorHandle } from '/@/logics/error-handle';
- import { router, setupRouter } from '/@/router';
- import { setupRouterGuard } from '/@/router/guard';
- import { setupStore } from '/@/store';
- import { setupGlobDirectives } from '/@/directives';
- import { setupI18n } from '/@/locales/setupI18n';
- import { registerGlobComp } from '/@/components/registerGlobComp';
- import { registerThirdComp } from '/@/settings/registerThirdComp';
- // 注册online模块lib
- // import { registerPackages } from '/@/utils/monorepo/registerPackages';
- import { initModalWorker, initTHREE } from '/@/utils/threejs/main.worker';
- import GlobalConfig from './components/config/GlobalConfig.vue';
- // 在本地开发中引入的,以提高浏览器响应速度
- if (import.meta.env.DEV) {
- // @ts-ignore
- import('ant-design-vue/dist/antd.less');
- }
- await getRemoteSetting();
- async function bootstrap() {
- // 创建应用实例
- const app = createApp(App);
- app.use(animate);
- // 多语言配置,异步情况:语言文件可以从服务器端获得
- await setupI18n(app);
- // 配置存储
- setupStore(app);
- // 初始化内部系统配置
- initAppConfigStore();
- // 注册外部模块路由(注册online模块lib)
- // registerPackages(app);
- // 注册全局组件
- registerGlobComp(app);
- // 配置路由
- setupRouter(app);
- // 路由保护
- setupRouterGuard(router);
- // 注册全局指令
- setupGlobDirectives(app);
- // 配置全局错误处理
- setupErrorHandle(app);
- // 注册第三方组件
- await registerThirdComp(app);
- // 当路由准备好时再执行挂载( https://next.router.vuejs.org/api/#isready)
- await router.isReady();
- initModalWorker();
- initTHREE();
- app.component('GlobalConfig', GlobalConfig);
- app.provide('globalConfig', {
- // 你的全局配置
- simulatedPassword: VENT_PARAM['simulatedPassword'],
- History_Type: History_Type['type'],
- pageType: '',
- showReport: VENT_PARAM['showReport'],
- });
- // 挂载应用
- app.mount('#app', true);
- console.log(' vue3 app 加载完成!');
- }
- bootstrap();
|