Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small program API picture full screen preview picture


May 18, 2021 WeChat Mini Program Development Document


Table of contents


wx.previewImage(Object object)

Preview the picture in full screen on the new page. During the preview, users can save pictures, send them to friends, and more.

Parameters

Object object

Property Type The default Required Description
urls Array.<string> Is A list of picture links that need to be previewed. 2.2.3 Support for cloud file IDs.
current string The first one of the urls Whether The link to the picture is currently displayed
success function Whether The interface calls a successful callback function
fail function Whether The interface calls the failed callback function
complete function Whether Callback function at end of interface call (call succeeds, fails are executed)

The sample code

wx.previewImage({
  current: '', // 当前显示图片的http链接
  urls: [] // 需要预览的图片http链接列表
})