Files
my-worker/web-vue/web/src/main.ts
2025-12-13 19:13:49 +08:00

66 lines
1.8 KiB
TypeScript

/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author ThinkGem
*/
import 'virtual:uno.css';
import 'ant-design-vue/dist/reset.css';
import '@jeesite/core/design/index.less';
import App from './App.vue';
import { createApp } from 'vue';
import { registerGlobComp } from '@jeesite/core/components/registerGlobComp';
import { initAppConfigStore } from '@jeesite/core/logics/initAppConfig';
import { setupErrorHandle } from '@jeesite/core/logics/error-handle';
import { setupGlobDirectives } from '@jeesite/core/directives';
import { setupI18n } from '@jeesite/core/locales/setupI18n';
import { setupRouter, router } from '@jeesite/core/router';
import { setupRouterGuard } from '@jeesite/core/router/guard';
import { setupStore } from '@jeesite/core/store';
import { setupDForm } from '@jeesite/dfm';
import * as echarts from 'echarts';
async function bootstrap() {
const app = createApp(App);
// Configure 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);
// https://next.router.vuejs.org/api/#isready
// await router.isReady();
// Dynamic Form
setupDForm();
app.config.globalProperties.$echarts = echarts;
if (typeof window !== 'undefined') {
window.echarts = echarts;
}
app.mount('#app');
}
bootstrap().then();