main.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import 'virtual:windi-base.css';
  2. import 'virtual:windi-components.css';
  3. import '/@/design/index.less';
  4. import 'virtual:windi-utilities.css';
  5. // Register icon sprite
  6. import 'virtual:svg-icons-register';
  7. import App from './App.vue';
  8. import { createApp } from 'vue';
  9. import { initAppConfigStore } from '/@/logics/initAppConfig';
  10. import { setupErrorHandle } from '/@/logics/error-handle';
  11. import { router, setupRouter } from '/@/router';
  12. import { setupRouterGuard } from '/@/router/guard';
  13. import { setupStore } from '/@/store';
  14. import { setupGlobDirectives } from '/@/directives';
  15. import { setupI18n } from '/@/locales/setupI18n';
  16. import { registerGlobComp } from '/@/components/registerGlobComp';
  17. import axios from 'axios';
  18. import VueGridLayout from 'vue-grid-layout';
  19. import Antd from 'ant-design-vue';
  20. import 'ant-design-vue/dist/antd.less';
  21. async function bootstrap() {
  22. const app = createApp(App);
  23. // Configure store
  24. // 配置 store
  25. setupStore(app);
  26. // Initialize internal system configuration
  27. // 初始化内部系统配置
  28. initAppConfigStore();
  29. // Register global components
  30. // 注册全局组件
  31. registerGlobComp(app);
  32. // Multilingual configuration
  33. // 多语言配置
  34. // Asynchronous case: language files may be obtained from the server side
  35. // 异步案例:语言文件可能从服务器端获取
  36. await setupI18n(app);
  37. // Configure routing
  38. // 配置路由
  39. setupRouter(app);
  40. // router-guard
  41. // 路由守卫
  42. setupRouterGuard(router);
  43. // Register global directive
  44. // 注册全局指令
  45. setupGlobDirectives(app);
  46. // Configure global error handling
  47. // 配置全局错误处理
  48. setupErrorHandle(app);
  49. //全局挂载axios
  50. app.config.globalProperties.$axios = axios;
  51. // https://next.router.vuejs.org/api/#isready
  52. // await router.isReady();
  53. app.use(Antd);
  54. app.use(VueGridLayout);
  55. app.mount('#app');
  56. }
  57. window.isPc = true;
  58. bootstrap();