gaoluyang
2026-06-24 712aa51536236d43e87273e4ce45ac5691dffad8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<script setup lang="ts">
import type { PopoverProperty } from './config';
 
import { ref } from 'vue';
 
import { IconifyIcon } from '..\..\..\..\..\..\..\..\packages\icons\src';
 
import { Image } from 'ant-design-vue';
 
/** 弹窗广告 */
defineOptions({ name: 'Popover' });
 
const props = defineProps<{ property: PopoverProperty }>();
 
const activeIndex = ref(0); // 选中 index
 
/** 处理选中 */
function handleActive(index: number) {
  activeIndex.value = index;
}
</script>
<template>
  <div
    v-for="(item, index) in props.property.list"
    :key="index"
    class="absolute bottom-1/2 right-1/2 h-[454px] w-[292px] rounded border border-gray-300 bg-white p-0.5"
    :style="{
      zIndex: 100 + index + (activeIndex === index ? 100 : 0),
      marginRight: `${-146 - index * 20}px`,
      marginBottom: `${-227 - index * 20}px`,
    }"
    @click="handleActive(index)"
  >
    <Image
      :src="item.imgUrl"
      :preview="false"
      class="h-full w-full object-contain"
    >
      <template #error>
        <div class="flex h-full w-full items-center justify-center">
          <IconifyIcon icon="lucide:image" />
        </div>
      </template>
    </Image>
    <div class="absolute right-1 top-1 text-xs">{{ index + 1 }}</div>
  </div>
</template>