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 +}