微信小程序點擊圖片預覽-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鏈接列表 })
 } })

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM