<!-- 轮播图 -->
<view style="height: {{height}}rpx;">
<swiper wx:if="{{list.imageurl.length>0}}" indicator-dots="{{true}}" current="currentTab" bindchange="switchTab" indicator-color="#2E8B57" circular="true" style="height:100%;">
<block wx:for="{{list.imageurl}}" wx:key="index" >
<swiper-item bindtap='{{item.caozuoname}}' style="justify-content: center;display: flex;align-items: center;">
<image src='{{item}}' bindtap="fangda" mode="aspectFit" style="border-radius: 5rpx;display: block;height: 1000rpx;;" />
</swiper-item>
</block>
</swiper>
</view>
解决方法就是用wx:if判断swiper是否需要渲染
如果里面是一个图片,但是src为null,就会报错,需要用wx:if判断,不能渲染没有src的图片
<swiper wx:if="{{list.imageurl.length>0}}" 这里