image组件无法显示图片,我设置了一些样式,然后图片地址是后端获取的,只有点开了图片之后才会正常显示是为什么
<image class="{{index==xindex?'imageBanner':'imageBanner_small'}}" data-index="{{index}}" data-item="item" bindtap="clickImg" src="{{item}}" wx:if="{{item.length>0}}"></image>
clickImg(res){
console.log(res)
var num=res.currentTarget.dataset.index
wx.previewImage({
urls:[this.data.banner[num]]
})
}
点开了功能是显示原图
<swiper class='bannerSwiper' previous-margin="54rpx" next-margin='54rpx' indicator-dots="true" indicator-color='#B5B5B5' indicator-active-color='#fff' interval='3000' duration='500' bindchange='onChange' circular='true'>
<block wx:for="{{banner}}" wx:key="index">
<swiper-item>
<image class="{{index==xindex?'imageBanner':'imageBanner_small'}}" data-index="{{index}}" data-item="item" bindtap="clickImg" src="{{item}}" wx:if="{{item.length>0}}"></image>
</swiper-item>
</block>
</swiper>
这是补充的内容,是一个轮播图