You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
677 B
37 lines
677 B
|
|
<template>
|
|
<div class="carousel">
|
|
<van-swipe :autoplay="3000" lazy-render >
|
|
<van-swipe-item v-for="(image, index) in data?.images" :key="index">
|
|
<img class="img-box" :src="image?.img" />
|
|
</van-swipe-item>
|
|
</van-swipe>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup name="carousel">
|
|
|
|
const props = defineProps({
|
|
carouselList: {
|
|
type: Array,
|
|
default: () => {
|
|
return [];
|
|
},
|
|
},
|
|
});
|
|
const data = reactive({
|
|
images: props?.carouselList,
|
|
});
|
|
</script>
|
|
<style lang="less">
|
|
.carousel {
|
|
height: 4rem;
|
|
.van-swipe{
|
|
height: 4rem;
|
|
}
|
|
.img-box {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
}
|
|
</style>
|