微信小程序:图片预览

wxml页面:

<image src='{{UPLOAD_IMAGES_URL}}{{vv.img_s}}' data-src="{{vv.img}}" bindtap="previewImage"></image>

js:

/*预览*/
previewImage:function(e){
    console.log('previewImage');
    var current = e.currentTarget.dataset.src;
    var that = this;
    var url = [that.data.UPLOAD_IMAGES_URL+current];
    wx.previewImage({
        current: current, // 当前显示图片的http链接
        urls: url // 需要预览的图片http链接列表
    })
}

猜你喜欢

转载自blog.csdn.net/qq_37461695/article/details/82957840