小程序点击按钮分享


wxml

<button open-type="share">
    <view>分享给好友</view>
</button>

JS

onShareAppMessage: function (res) {
  if (res.from === 'button') {
    console.log(res.target)
  }
  return {
    title: "分享给好友",
    path: '/pages/share/share',
    imgurl:'',
    success: function (res) {
      console.log('成功', res)
    }
  }
},

文章作者: Born to the sun
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 Born to the sun !
评论
  目录