预览图片功能 直接复制就OK
wx.js
previewImage(val) { let result=val.currentTarget.dataset.item; const that = this; wx.previewImage({ current: result, // 当前显示图片的http链接 urls: that.data.homeList.imagesUrl // 需要预览的图片http链接列表 }) },
wx.ml
<block wx:for="{{homeList.imagesUrl}}">
<view class="upload_item" wx:key="{{index}}">
<image src="{{item}}" class="img" alt="" data-item="{{item}}" bindtap="previewImage" />
</view>
</block>