You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.4 KiB
55 lines
1.4 KiB
import '/@/assets/styles/index.less'; |
|
|
|
// 注册windi |
|
import 'virtual:windi.css'; |
|
// 注册svg图标精灵 |
|
import 'virtual:svg-icons-register'; |
|
import App from './App.vue'; |
|
import { createApp } from 'vue'; |
|
import { initAppConfigStore } from '/@/logics/initAppConfig'; |
|
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'; |
|
|
|
// 在本地开发中不引入按需? |
|
// 在按需引入的本地开发中,浏览器请求的数量将增加 20% 左右。 |
|
// 这可能会减慢浏览器的刷新速度。 |
|
// 所以都是在本地开发中引入,生产环境中才按需引入 |
|
if (import.meta.env.DEV) { |
|
import('ant-design-vue/dist/antd.less'); |
|
} |
|
|
|
async function bootstrap() { |
|
const app = createApp(App); |
|
|
|
// 配置 store |
|
setupStore(app); |
|
|
|
// 初始化内部系统配置 |
|
initAppConfigStore(); |
|
|
|
// 注册antd全局组件 |
|
registerGlobComp(app); |
|
|
|
// 多语言配置 |
|
await setupI18n(app); |
|
|
|
// 配置路由 |
|
setupRouter(app); |
|
|
|
// 路由器保护 |
|
setupRouterGuard(router); |
|
|
|
// 注册全局指令 |
|
setupGlobDirectives(app); |
|
|
|
// 路线准备好时挂载: https://next.router.vuejs.org/api/#isready |
|
await router.isReady(); |
|
|
|
app.mount('#app', true); |
|
} |
|
|
|
void bootstrap();
|
|
|