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

This commit is contained in:
奔跑的面条
2023-01-09 19:32:09 +08:00
parent 1b6c1a3530
commit 13467e569f
60 changed files with 128 additions and 129 deletions
@@ -22,7 +22,7 @@
</n-text>
</div>
<div class="list-center go-flex-center go-transition">
<img class="list-img" v-lazy="item.image" alt="图表图片" />
<charts-item-image class="list-img" :chartConfig="item"></charts-item-image>
</div>
<div class="list-bottom">
<n-text class="list-bottom-text" depth="3">
@@ -37,6 +37,7 @@
<script setup lang="ts">
import { PropType, watch, ref, Ref, computed, nextTick } from 'vue'
import { MacOsControlBtn } from '@/components/Tips/MacOsControlBtn/index'
import { ChartsItemImage } from '../ChartsItemImage'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import { EditCanvasTypeEnum } from '@/store/modules/chartEditStore/chartEditStore.d'
import { ChartModeEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d'
@@ -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>