4 changed files with 102 additions and 28 deletions
@ -0,0 +1,61 @@ |
|||||
|
<template> |
||||
|
<swiper |
||||
|
v-if="acList.length > 1" |
||||
|
:modules="modules" |
||||
|
:slides-per-view="1.6" |
||||
|
:space-between="20" |
||||
|
:observer="true" |
||||
|
:centered-slides="true" |
||||
|
:initial-slide="acList.length !== 1 ? 1 : 0" |
||||
|
:loop="acList.length !== 1 ? true : false" |
||||
|
:pagination="{ clickable: false }" |
||||
|
:autoplay="acList.length !== 1 ? { delay: 5000, disableOnInteraction: false } : false" |
||||
|
:prevent-clicks-propagation="true" |
||||
|
:prevent-clicks="false" |
||||
|
:dynamic-bullets="true" |
||||
|
:threshold="100" |
||||
|
class="myswiper" |
||||
|
> |
||||
|
<swiper-slide v-for="(item, index) in acList" :key="index"> |
||||
|
<img :src="item.fileUrl" class="img" /> |
||||
|
</swiper-slide> |
||||
|
</swiper> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import { ref } from 'vue' |
||||
|
import { Swiper, SwiperSlide } from 'swiper/vue' |
||||
|
import { Autoplay, Pagination } from 'swiper' |
||||
|
// Import Swiper styles |
||||
|
import 'swiper/css' |
||||
|
import 'swiper/css/pagination' |
||||
|
const modules = ref([Autoplay, Pagination]) |
||||
|
defineProps(['acList']) |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
:deep(.swiper-pagination) { |
||||
|
bottom: 0; |
||||
|
height: 20px; |
||||
|
} |
||||
|
:deep(.swiper-pagination-bullet) { |
||||
|
width: 12px; |
||||
|
height: 4px; |
||||
|
margin-right: 4px; |
||||
|
background: #d8d5cf; |
||||
|
border-radius: 69px; |
||||
|
} |
||||
|
:deep(.swiper-pagination-bullet-active) { |
||||
|
background: #84754e; |
||||
|
border-radius: 4px; |
||||
|
} |
||||
|
.myswiper { |
||||
|
width: 1920px; |
||||
|
height: 650px; |
||||
|
.img { |
||||
|
width: 1080px; |
||||
|
height: 608px; |
||||
|
border-radius: 24px; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
Loading…
Reference in new issue