mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-06 03:58:04 +08:00
fix: 处理搜索结果无法展示图片的问题
This commit is contained in:
parent
5dd39926f8
commit
8e28c524b3
@ -63,7 +63,8 @@ export const fetchConfigComponent = (dropData: ConfigType) => {
|
|||||||
* * 获取图片内容
|
* * 获取图片内容
|
||||||
* @param {ConfigType} targetData 配置项
|
* @param {ConfigType} targetData 配置项
|
||||||
*/
|
*/
|
||||||
export const fetchImages = async (targetData: ConfigType) => {
|
export const fetchImages = async (targetData?: ConfigType) => {
|
||||||
|
if (!targetData) return ''
|
||||||
// 新数据动态处理
|
// 新数据动态处理
|
||||||
const { image, package: targetDataPackage } = targetData
|
const { image, package: targetDataPackage } = targetData
|
||||||
// 兼容旧数据
|
// 兼容旧数据
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
<template>
|
||||||
|
<img v-lazy="imageInfo" alt="展示图" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, PropType } from 'vue'
|
||||||
|
import { ConfigType } from '@/packages/index.d'
|
||||||
|
import { fetchImages } from '@/packages'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
item: {
|
||||||
|
type: Object as PropType<ConfigType>,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const imageInfo = ref('')
|
||||||
|
|
||||||
|
// 获取图片
|
||||||
|
const fetchImageUrl = async () => {
|
||||||
|
imageInfo.value = await fetchImages(props.item)
|
||||||
|
}
|
||||||
|
fetchImageUrl()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
@ -37,7 +37,7 @@
|
|||||||
:title="item.title"
|
:title="item.title"
|
||||||
@click="selectChartHandle(item)"
|
@click="selectChartHandle(item)"
|
||||||
>
|
>
|
||||||
<img class="list-item-img" v-lazy="item.image" alt="展示图" />
|
<search-image class="list-item-img" :item="item"></search-image>
|
||||||
<n-text class="list-item-fs" depth="2">{{ item.title }}</n-text>
|
<n-text class="list-item-fs" depth="2">{{ item.title }}</n-text>
|
||||||
</div>
|
</div>
|
||||||
</n-scrollbar>
|
</n-scrollbar>
|
||||||
@ -77,6 +77,7 @@ import { useChartLayoutStore } from '@/store/modules/chartLayoutStore/chartLayou
|
|||||||
import { isString, addEventListener, removeEventListener } from '@/utils'
|
import { isString, addEventListener, removeEventListener } from '@/utils'
|
||||||
import { fetchConfigComponent, fetchChartComponent } from '@/packages/index'
|
import { fetchConfigComponent, fetchChartComponent } from '@/packages/index'
|
||||||
import { componentInstall, loadingStart, loadingFinish, loadingError } from '@/utils'
|
import { componentInstall, loadingStart, loadingFinish, loadingError } from '@/utils'
|
||||||
|
import SearchImage from './SearchImage.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
menuOptions: {
|
menuOptions: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user