Browse Source

Merge pull request 'fix:修复图片动态引入' (#46) from dev-xjf into master

Reviewed-on: http://120.26.116.243:3000/root/alert-front/pulls/46
YKS
xiaojinfei 3 weeks ago
parent
commit
90f9ad64ae
  1. 1
      src/views/dashboard/demo/components/demo.json
  2. 4
      src/views/dashboard/demo/components/staticImg.vue

1
src/views/dashboard/demo/components/demo.json

@ -2,7 +2,6 @@
"title": "示例设备展示",
"LeftUp": {
"Header": "设备静态图",
"pathq": "/src/assets/images/header.jpg",
"path": "/src/assets/svg/illustration.svg",
"Content": ""
},

4
src/views/dashboard/demo/components/staticImg.vue

@ -1,5 +1,6 @@
<script lang="ts" setup>
import { Card, CardGrid } from 'ant-design-vue'
import { ref } from 'vue'
import { navItems } from './data'
import { Icon } from '@/components/Icon'
@ -9,10 +10,11 @@ const props = defineProps({
default: () => {},
},
})
const imgUrl = ref(new URL(props.data.path, import.meta.url).href)
</script>
<template>
<Card class="enter-y !my-1" :title="props.data.Header">
<img class="mx-auto h-50 w-full" :src="props.data.path">
<img class="mx-auto h-50 w-full" :src="imgUrl">
</Card>
</template>

Loading…
Cancel
Save