From 6767579d025b083a5b57afaa5882e0f530af25c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=96=E6=99=8B=E9=A3=9E?= <378266566@qq.com> Date: Mon, 15 Sep 2025 16:15:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=9B=BE=E7=89=87=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dashboard/demo/components/demo.json | 4 ++-- src/views/dashboard/demo/components/staticImg.vue | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/views/dashboard/demo/components/demo.json b/src/views/dashboard/demo/components/demo.json index 3021da8..1acfd9f 100644 --- a/src/views/dashboard/demo/components/demo.json +++ b/src/views/dashboard/demo/components/demo.json @@ -2,7 +2,7 @@ "title": "示例设备展示", "LeftUp": { "Header": "设备静态图", - "path": "../../../../assets/svg/illustration.svg", + "path": "svg/illustration.svg", "Content": "" }, "LeftMidUp": { @@ -52,7 +52,7 @@ }, "LeftDown": { "Header": "生产流程", - "path": "../../../../assets/svg/illustration.svg", + "path": "svg/illustration.svg", "Content": "/api/v1/assets/production_flow.svg" }, "RightDown": { diff --git a/src/views/dashboard/demo/components/staticImg.vue b/src/views/dashboard/demo/components/staticImg.vue index c4e5d00..95139bd 100644 --- a/src/views/dashboard/demo/components/staticImg.vue +++ b/src/views/dashboard/demo/components/staticImg.vue @@ -10,7 +10,11 @@ const props = defineProps({ default: () => {}, }, }) -const imgUrl = ref(new URL(props.data.path, import.meta.url).href) +const imgUrl = getAssetsFile(props.data.path) +// ../assets/imgs为图片公共路径 +function getAssetsFile(url: string) { + return new URL(`../../../../assets/${url}`, import.meta.url).href +}