| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <template>
- <swiper
- class="image-swiper"
- circular
- :indicator-dots="true"
- :autoplay="true"
- :interval="2000"
- :duration="1000"
- >
- <swiper-item v-for="(item, key) in images" :key="key">
- <view class="item">
- <Image
- :src="item"
- width="100%"
- :radius="15"
- mode="aspectFill"
- touchable
- @click="onPreviewImage(key)"
- />
- </view>
- </swiper-item>
- </swiper>
- </template>
- <script setup lang="ts">
- import { useSwiperImagePreview } from '@/common/composeabe/SwiperImagePreview';
- import Image from '@/components/basic/Image.vue';
- import type { PropType } from 'vue';
- const props = defineProps({
- images: {
- type: Array as PropType<string[]>,
- default: () => [],
- },
- })
- const { onPreviewImage } = useSwiperImagePreview(() => props.images || [])
- </script>
- <style lang="scss">
- .image-swiper {
- height: 400rpx;
- image {
- border-radius: 20rpx;
- }
- }
- </style>
|