小程序轮播图中间大两边小
Posted 珺L
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了小程序轮播图中间大两边小相关的知识,希望对你有一定的参考价值。
不说这么多,直接上代码
<swiper class="swiper-block" previous-margin="90rpx" next-margin="90rpx" autoplay="{{yearOutoplay}}" current="0" circular=\'true\' bindchange="yearSwiperChange" > <block wx:for="{{yearimgUrls}}" wx:index="{{index}}" wx:key=\'\'> <swiper-item class="swiper-item"> <image mode="aspectFill" src="{{item.url}}" class="slide-image {{swiperCurrent == index ? \'active\' : \'\'}}"/> </swiper-item> </block> </swiper>
swiperCurrent: 0, yearOutoplay:false, yearimgUrls: [ { url:\'../../images/banner.jpg\', }, { url:\'../../images/banner.jpg\', }, { url:\'../../images/banner.jpg\', }, ],
yearSwiperChange(e) {
let current = e.detail.current;
let that = this;
that.setData({
swiperCurrent: current,
})
},
以上是关于小程序轮播图中间大两边小的主要内容,如果未能解决你的问题,请参考以下文章