mc.previewImage(Object object)

在新页面中全屏预览图片。

Object object 参数

属性 类型 默认值 必填 说明 最低版本
urls [String] 需要预览的图片链接列表。
showmenu Boolean true 是否显示长按菜单
current String urls 的第一张 当前显示图片的链接
referrerPolicy String no-referrer origin: 发送完整的 referrer; no-referrer: 不发送。
success Function 接口调用成功的回调函数
fail Function 接口调用失败的回调函数
complete Function 接口调用结束的回调函数(调用成功、失败都会执行)  

示例代码:

 previewImage: function (e) {
    mc.previewImage({
      urls: [
        'http://cn.bing.com/th?id=OHR.OberweissbacherBergbahn_EN-CN3026301899_UHD.jpg',
        'https://cn.bing.com/th?id=OHR.ReddishEgret_EN-CN3104674362_UHD.jpg',
        'https://cn.bing.com/th?id=OHR.SemucChampey_EN-CN8984695719_UHD.jpg',
        'https://cn.bing.com/th?id=OHR.SouthernGate_EN-CN5746299507_UHD.jpg'
      ],
      complete: (res) => {
        this.setData({
          previewImageInfo: JSON.stringify(res, null, 2)
        })
      }
    })
  },

results matching ""

    No results matching ""

    results matching ""

      No results matching ""