|
@@ -1,26 +1,25 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <v-carousel cycle hide-delimiter-background :show-arrows="false" style="width: 100%; max-width: 100%; height: auto;">
|
|
|
- <v-carousel-item v-for="(item, i) in carouselList" :key="i">
|
|
|
- <v-img :src="item.url" :lazy-src="item.url">
|
|
|
- <template v-slot:placeholder>
|
|
|
- <v-row align="center" class="fill-height ma-0" justify="center">
|
|
|
- <v-progress-circular color="grey-lighten-5" indeterminate></v-progress-circular>
|
|
|
- </v-row>
|
|
|
- </template>
|
|
|
- </v-img>
|
|
|
- </v-carousel-item>
|
|
|
- </v-carousel>
|
|
|
- </div>
|
|
|
+ <v-carousel cycle hide-delimiter-background :show-arrows="false" style="width: 100%; max-width: 100%; height: auto;">
|
|
|
+ <v-carousel-item v-for="(item, i) in carouselList" :key="i">
|
|
|
+ <v-img :src="item.imgUrl" :lazy-src="item.imgUrl">
|
|
|
+ <template v-slot:placeholder>
|
|
|
+ <v-row align="center" class="fill-height ma-0" justify="center">
|
|
|
+ <v-progress-circular color="grey-lighten-5" indeterminate></v-progress-circular>
|
|
|
+ </v-row>
|
|
|
+ </template>
|
|
|
+ </v-img>
|
|
|
+ </v-carousel-item>
|
|
|
+ </v-carousel>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
defineOptions({ name: 'mall-home-carousel'})
|
|
|
+import { ref } from 'vue'
|
|
|
+const props = defineProps({ templateData: Object })
|
|
|
|
|
|
-const carouselList = [
|
|
|
- { url: 'https://wx-static.ydjdev.com/resource-1730081781870-30114.jpg?imageView2/0/w/1920' },
|
|
|
- { url: 'https://wx-static.ydjdev.com/resource-1730084780292-95821.jpg?imageView2/0/w/1920' },
|
|
|
-]
|
|
|
+const carouselList = ref([])
|
|
|
+const Carousel = props.templateData?.home?.components.find(item => item.id === 'Carousel')
|
|
|
+carouselList.value = Carousel.property.items
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|