title: Taro.showShareImageMenu(option)

sidebar_label: showShareImageMenu

打开分享图片弹窗,可以将图片发送给朋友、收藏或下载

支持情况:showShareImageMenu - 图1 showShareImageMenu - 图2 showShareImageMenu - 图3

参考文档

类型

  1. (option: Option) => Promise<TaroGeneral.CallbackResult>

参数

参数 类型
option Option

Option

参数 类型 必填 说明
path string 要分享的图片地址,必须为本地路径或临时路径
success (res: TaroGeneral.CallbackResult) => void 接口调用成功的回调函数
fail (res: TaroGeneral.CallbackResult) => void 接口调用失败的回调函数
complete (res: TaroGeneral.CallbackResult) => void 接口调用结束的回调函数(调用成功、失败都会执行)

示例代码

  1. Taro.downloadFile({
  2. url: 'https://res.wx.qq.com/wxdoc/dist/assets/img/demo.ef5c5bef.jpg',
  3. success: (res) => {
  4. wx.showShareImageMenu({
  5. path: res.tempFilePath
  6. })
  7. }
  8. })