swiper组件不轮播图片,只显示第一张图片
https://developers.weixin.qq.com/miniprogram/dev/component/swiper.html
本来添加了四张图片,写了autoplay="true" indicator-dots="true" circular="true"
等属性 ,可是只显示第一张,而且也没轮播,求教呀QAQ
4 回复
楼主swiper
里面要嵌套swiper-item组件,4张图片需要4个swiper-item
是不是忘记啦?
参考代码:
<swiper autoplay="true" bindchange="swiperChange" style="height: 500rpx">
<block wx:for="{{imageUrls}}" wx:key="*this">
<swiper-item>
<image src="{{item}}" class="slide-image" bindtap="previewImage"mode="aspectFill" lazy-load="{{true}}" />
</swiper-item>
</block>
</swiper>
imageUrls:['xxx.jpg','yyyy.jpg']