>》>》>》>》

微信小程序点击图片预览-wx.previewImage

<view class='imgList'>      
  <view class='imgList-li' wx:for='{{imgArr}}'>
    <image class='img' src='{{item}}' data-index='{{index}}' bindtap='previewImg'></image>
  </view>
</view>
Page({
 
  /**
   * 页面的初始数据
   */
  data: {
    imgArr:[
      'http://bpic.jpg',
      'http://bpic.jpg',
      'http://bpic.jpg',
      'http://bpic.jpg'
    ]
  },
  previewImg:function(e){
  let _this = this
  //图片预览
    wx.previewImage({
      current:_this.imgArr[0] , // 当前显示图片的http链接
      urls: _this.imgList // 需要预览的图片http链接列表
    })
 } })

 

posted @ 2019-10-29 11:07  大、锤  阅读(7450)  评论(0编辑  收藏  举报