fix: 处理组件图片路径会报错的问题

This commit is contained in:
奔跑的面条
2023-01-09 19:32:09 +08:00
parent 462a613bd3
commit f82cde2faf
60 changed files with 128 additions and 129 deletions
@@ -0,0 +1,3 @@
import ChartsItemImage from './index.vue'
export { ChartsItemImage }
@@ -0,0 +1,24 @@
<template>
<img class="list-img" v-lazy="imageInfo" alt="图表图片" />
</template>
<script setup lang="ts">
import { ref, PropType } from 'vue'
import { fetchImages } from '@/packages'
import { ConfigType } from '@/packages/index.d'
const props = defineProps({
chartConfig: {
type: Object as PropType<ConfigType>,
required: true
},
})
const imageInfo = ref('')
// 获取图片
const fetchImageUrl = async () => {
imageInfo.value = await fetchImages(props.chartConfig)
}
fetchImageUrl()
</script>