wx.previewImage参数current的BUG?
问题描述 :
previewImage current (当前显示图片的链接,不填则默认为 urls 的第一张)
默认了current 后还是显示的
urls 列表中的第一张图片
反馈图如下:
<
view
class
=
“img_item”
wx:for
=
"{{picList}}"
wx:for-item
=
“item”
>
<
image
src
=
"{{item.url}}"
bindtap
=
“viewPic”
data-url
=
"{{item.url}}"
></
image
>
</
view
>
viewPic: function (e) { var _this = this ; var nowpic = e.target.dataset.url; var picList = _this.data.picList; var urls = []; for ( var i = 0; i < picList.length; i++) { //console.log(picList[i].url); urls.push( picList[i].url); } console.log(nowpic); wx.previewImage({ current: nowpic, // 当前显示图片的http链接 urls: urls, // 需要预览的图片http链接列表 }) }, |