小程序需求:如果请求图片 404 则不显示这个 view 层,该怎么实现?
这是遍历出来的段子,一个view层里有文字和图片,如果图片404时则不让这个层显示出来
<view wx:for="{{pindao.data}}" class='items'>
<view wx:if="{{item.text !== null}}" class='title'>{{item.text}}</view>
<view wx:if="{{item.image !== null}}" class=''><image binderror='imgerror' bindtap='previewImage' mode='aspectFill' data-src="{{item.image}}" src="{{item.image}}"></image></view>
<view wx:if="{{item.gif !== null}}" class=''><image binderror="imgerror" src="{{item.gif}}"></image></view></view>
推荐文章: