From 70289632f3691a8743b62f6d4cc03068d0047077 Mon Sep 17 00:00:00 2001 From: hongawen <83944980@qq.com> Date: Wed, 9 Oct 2024 20:37:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=BE=AE=E8=B0=83=20?= =?UTF-8?q?=E6=95=B4=E5=90=88SVG=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../staticExtend/SvgIcon/src/SvgIcon.vue | 1 - frontend/src/main.ts | 22 +++++++++++++++++-- frontend/src/views/home/tabs/model.vue | 1 - 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/staticExtend/SvgIcon/src/SvgIcon.vue b/frontend/src/components/staticExtend/SvgIcon/src/SvgIcon.vue index f3723bb..f51b8bf 100644 --- a/frontend/src/components/staticExtend/SvgIcon/src/SvgIcon.vue +++ b/frontend/src/components/staticExtend/SvgIcon/src/SvgIcon.vue @@ -17,7 +17,6 @@ defineOptions({ name: 'SvgIcon', }) -import { computed } from 'vue' import type { CSSProperties } from 'vue' // 定义组件对外暴露的props const props = defineProps({ diff --git a/frontend/src/main.ts b/frontend/src/main.ts index c317fdb..96e15a0 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -25,7 +25,7 @@ import * as Icons from "@element-plus/icons-vue"; // custom directives import directives from "@/directives/index"; // vue Router -import router from "@/routers"; +import Router from "@/routers"; // vue i18n import I18n from "@/languages/index"; // pinia store @@ -33,6 +33,8 @@ import pinia from "@/stores"; // errorHandler import errorHandler from "@/utils/errorHandler"; +import registerGlobComp from '@/components' + const app = createApp(App); app.config.errorHandler = errorHandler; @@ -42,4 +44,20 @@ Object.keys(Icons).forEach(key => { app.component(key, Icons[key as keyof typeof Icons]); }); -app.use(ElementPlus).use(directives).use(router).use(I18n).use(pinia).mount("#app"); +const setupAll = async () => { + app + .use(ElementPlus) + .use(directives) + .use(Router) // 使用路由 + .use(I18n) + .use(pinia) + .use(registerGlobComp) // 使用全局自定义组件 + + //待路由初始化完毕后,挂载app + await Router.isReady() +} + +//挂载app +setupAll().then(() => { + app.mount('#app') +}) diff --git a/frontend/src/views/home/tabs/model.vue b/frontend/src/views/home/tabs/model.vue index f353da8..cea865a 100644 --- a/frontend/src/views/home/tabs/model.vue +++ b/frontend/src/views/home/tabs/model.vue @@ -200,7 +200,6 @@ onMounted(() => { font-weight: 400; font-style: normal; color: #fff; - line-height: 20px; text-align: center; line-height: 40px; cursor: pointer;