<template>
  <el-tooltip placement="top">
    <template #content>
      <template v-if="imgs.length > 0">
        <img
          v-for="item in imgs"
          :key="item.IMGFILES_ID"
          :src="VITE_FILE_URL + item.FILEPATH"
          width="100"
          height="100"
          alt=""
          class="ml-10"
        />
      </template>
      <span v-else>暂无图片</span>
    </template>
    <el-tag>预览</el-tag>
  </el-tooltip>
</template>

<script setup>
defineOptions({
  name: "LayoutTooltipImg",
});
const VITE_FILE_URL = import.meta.env.VITE_FILE_URL;
defineProps({
  imgs: {
    type: Array,
    required: true,
    default: () => [],
  },
});
</script>

<style scoped lang="scss"></style>
