|
|
@ -1,27 +1,28 @@ |
|
|
<template> |
|
|
<template> |
|
|
|
|
|
<!-- |
|
|
|
|
|
:observer="true" |
|
|
|
|
|
--> |
|
|
<swiper |
|
|
<swiper |
|
|
v-if="acList.length" |
|
|
v-if="acList.length" |
|
|
:modules="modules" |
|
|
:modules="modules" |
|
|
:slides-per-view="1.12" |
|
|
:slides-per-view="1.12" |
|
|
:observer="true" |
|
|
|
|
|
:centered-slides="true" |
|
|
:centered-slides="true" |
|
|
:initial-slide="acList.length !== 1 ? 1 : 0" |
|
|
:initial-slide="acList.length !== 1 ? 1 : 0" |
|
|
:loop="acList.length > 3 ? true : false" |
|
|
|
|
|
|
|
|
:loop="acList.length >= 2 ? true : false" |
|
|
:pagination="true" |
|
|
:pagination="true" |
|
|
:autoplay="acList.length > 3 ? { delay: 7000, disableOnInteraction: false } : false" |
|
|
|
|
|
|
|
|
:autoplay="acList.length >= 2 ? { delay: 3000, disableOnInteraction: false } : false" |
|
|
:dynamic-bullets="true" |
|
|
:dynamic-bullets="true" |
|
|
:space-between="16" |
|
|
:space-between="16" |
|
|
class="myswiper" |
|
|
class="myswiper" |
|
|
> |
|
|
> |
|
|
<swiper-slide v-for="item in acList" :key="item.code"> |
|
|
|
|
|
<img :src="item.fileUrl" class="img" /> |
|
|
|
|
|
|
|
|
<swiper-slide v-for="item in acList" :key="item.advertisingCode"> |
|
|
|
|
|
<img :key="item.advertisingCode" :src="item.fileUrl" class="img" /> |
|
|
</swiper-slide> |
|
|
</swiper-slide> |
|
|
</swiper> |
|
|
</swiper> |
|
|
<img v-else src="../../assets/images/nodata.svg" class="stay-tuned" alt="" /> |
|
|
<img v-else src="../../assets/images/nodata.svg" class="stay-tuned" alt="" /> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import { ref } from 'vue' |
|
|
|
|
|
import { Swiper, SwiperSlide } from 'swiper/vue' |
|
|
import { Swiper, SwiperSlide } from 'swiper/vue' |
|
|
import { Autoplay, Pagination } from 'swiper' |
|
|
import { Autoplay, Pagination } from 'swiper' |
|
|
import 'swiper/css' |
|
|
import 'swiper/css' |
|
|
@ -30,7 +31,7 @@ type AcType = { |
|
|
acList: HomeImage[] |
|
|
acList: HomeImage[] |
|
|
} |
|
|
} |
|
|
defineProps<AcType>() |
|
|
defineProps<AcType>() |
|
|
const modules = ref([Autoplay, Pagination]) |
|
|
|
|
|
|
|
|
const modules = [Autoplay, Pagination] |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|
|