<template>
	<el-image v-if="src" :src="prefix+src" :preview-src-list="previewList" v-bind="attrs"/>
</template>

<script setup>
import config from "@/config"
import {computed, useAttrs} from "vue"

const attrs = useAttrs()
const props = defineProps({
	src: {type: String, default: ""},
	previewSrcList: {type: Array, default: []}
})
const prefix = config.API_URL + '/'

const previewList = computed(() => {
	if (!props.previewSrcList?.length) return []
	return props.previewSrcList.map(i => prefix + i)
})
</script>
