为什么只能预览第一张图片
<button bindtap="xz" style="margin-top: 10px;border-radius: 5px;border: rgb(1, 1, 3) 1px solid">选择图片button>
<view class="img-view">
<view class="show" wx:for="{{ imgOne }}" wx:key="_id">
<image src="{{ item }}" mode="aspectFill"bindtap="previewImg">image>
view>
<view class="up" wx:if="{{imgOneSwitch}}" bindtap="xz">+view>
view>
previewImg:function(e){
console.log("放大图片");
wx.previewImage({
urls:this.data.imgOne
})
},
点哪张看哪张
mode="aspectFill"bindtap="previewImg" 之间加个空格 。还有就是给 previewImg 穿个参数才行 。
<image src="{{ item }}" mode="aspectFill" bindtap="previewImg(item)"></image>
previewImg:function(url){
console.log("放大图片");
wx.previewImage({
urls:url
})
},