渲染有问题:
<swiper style="height: 300rpx;" indicator-dots="{{true}}" indicator-color="#FFFFFF80" indicator-active-color="#fff" autoplay="{{true}}" interval="{{3000}}" duration="{{500}}">
<block wx:for="{{list}}" wx:key="index">
<swiper-item style="border-radius: 16rpx 16rpx 16rpx 16rpx;height: 100%;">
<view>
<image src="{{item.fvOssUrl}}" style="width: 100%;height: 300rpx;" mode="aspectFill"></image>
</view>
</swiper-item>
</block>
</swiper>
微信的官方swiper组件有一个bug,不要在swiper-item上写style样式,否则会造成轮播渲染失败,只显示一张图。
解决方法:
swiper内部要用block嵌套
不要在swiper-item上写style样式
有组件就用组件,这里用的vant的图片组件van-image
<swiper style="height: 300rpx;" indicator-dots="{{true}}" indicator-color="#FFFFFF80" indicator-active-color="#fff" autoplay="{{true}}" interval="{{3000}}" duration="{{500}}">
<block wx:for="{{list}}" wx:key="index">
<swiper-item>
<view>
<van-image width="100%" height="300rpx" src="{{item.fvOssUrl}}" />
</view>
</swiper-item>
</block>
</swiper>
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。