12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- import 'uno.css';
- import '@/design/index.less';
- import '@/components/VxeTable/src/css/index.scss';
- import 'ant-design-vue/dist/reset.css';
- // Register icon sprite
- import 'virtual:svg-icons-register';
- import { createApp } from 'vue';
- import 'vxe-table/lib/style.css';
- 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';
- declare global {
- interface Window {
- updateFavicon: (url: string) => void;
- }
- }
- // 定义全局的更新 favicon 函数
- window.updateFavicon = function (url: string) {
- let link = document.querySelector("link[rel~='icon']") as HTMLLinkElement;
- if (!link) {
- link = document.createElement('link') as HTMLLinkElement;
- link.rel = 'icon';
- document.head.appendChild(link);
- }
- link.href = url;
- };
- async function bootstrap() {
- const app = createApp(App);
- app.config.warnHandler = () => {
- // 在这里处理或记录警告
- };
- // Configure store
- // 配置 store
- setupStore(app);
- // Initialize internal system configuration
- // 初始化内部系统配置
- initAppConfigStore();
- // Register global components
- // 注册全局组件
- registerGlobComp(app);
- // Multilingual configuration
- // 多语言配置
- // Asynchronous case: language files may be obtained from the server side
- // 异步案例:语言文件可能从服务器端获取
- await setupI18n(app);
- // Configure routing
- // 配置路由
- setupRouter(app);
- // router-guard
- // 路由守卫
- setupRouterGuard(router);
- // Register global directive
- // 注册全局指令
- setupGlobDirectives(app);
- // Configure global error handling
- // 配置全局错误处理
- setupErrorHandle(app);
- if (process.env.NODE_ENV === 'development') {
- app.config.warnHandler = () => {};
- }
- // https://next.router.vuejs.org/api/#isready
- // await router.isReady();
- app.mount('#app');
- }
- bootstrap();
|