小程序獲取圖片的寬高

代碼:


  imgInfo(url){
    wx.getImageInfo({
      src: url,
      success (res) {
        console.log(res.width)
        console.log(res.height)
        return {width:res.width,height:res.height}
      }
    })
  },

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章