import App from '@af-mobile-client-vue3/App.vue' import bootstrap from '@af-mobile-client-vue3/bootstrap' import Plugins from '@af-mobile-client-vue3/plugins' import router from '@af-mobile-client-vue3/router' import pinia from '@af-mobile-client-vue3/stores' import { i18n } from '@af-mobile-client-vue3/utils/i18n' // MateChat ai 对话相关 import MateChat from '@matechat/core' import { createHead } from '@unhead/vue/client' import { createApp } from 'vue' import 'virtual:uno.css' import '@af-mobile-client-vue3/styles/app.less' import '@af-mobile-client-vue3/styles/var.less' // Vant 桌面端适配 import '@vant/touch-emulator' /* -------------------------------- Vant 中有个别组件是以函数的形式提供的, 包括 Toast,Dialog,Notify 和 ImagePreview 组件。 在使用函数组件时,unplugin-vue-components 无法自动引入对应的样式,因此需要手动引入样式。 ------------------------------------- */ import 'vant/es/toast/style' import 'vant/es/dialog/style' import 'vant/es/notify/style' (async () => { const app = createApp(App) const head = createHead() app.use(head) app.use(router) app.use(pinia) app.use(i18n) app.use(Plugins) app.use(MateChat) await bootstrap(router) app.mount('#system-app') // 👇 将卸载操作放入 unmount 函数,就是上面步骤2中的卸载函数 window.unmount = () => { app.unmount() } })()