This commit is contained in:
魏啾
2024-04-08 13:50:05 +08:00
parent 2b723694fa
commit d844832aad
13 changed files with 1309 additions and 124 deletions

View File

@@ -1,8 +1,8 @@
<template>
<view class="viewswiper">
<u-swiper :list="list1" @change="e => current = e.current" indicatorStyle="right: 20px" height='484'>
<u-swiper :list="carousel" keyName="coverImg" @change="e => current = e.current" indicatorStyle="right: 20px" height='484'>
<view slot="indicator" class="indicator">
<view class="indicator__dot" v-for="(item, index) in list1" :key="index"
<view class="indicator__dot" v-for="(item, index) in carousel" :key="index"
:class="[index === current && 'indicator__dot--active']"
:style="[index === current && {'width':16+'px'}]">
</view>
@@ -15,14 +15,25 @@
export default {
data() {
return {
current: 0,
list1: [
'https://cdn.uviewui.com/uview/swiper/swiper1.png',
'https://cdn.uviewui.com/uview/swiper/swiper2.png',
'https://cdn.uviewui.com/uview/swiper/swiper3.png',
]
current: 0
};
},
props: {
carousel: {
type: Array,
default () {
return []
}
},
title: {
type: String,
default: '每日特价'
},
img: {
type: String,
default: ''
},
},
};
</script>