小程序 button分享自定义页面 open-type="share" 没有触发onShareAppMessage事件

aaa.wxml

<button open-type="share">
    分享
  </button>

aaa.js

  // 用户点击按钮分享
  onShareAppMessage: function (res) {
      if (res.from === 'button') {
          // 来自页面内转发按钮
          console.log(res.target)
      }
      return {
          title: '自定义!',
          path: '/share/beInvolved/beInvolved',
          imageUrl: '../../img/share.png',
          success: function(res) {},
          fail: function() {}
      }
  },

踩坑纪实:
创建page的js底部自有onShareAppMessage事件
自定义的onShareAppMessage 被底部空白的 onShareAppMessage 干掉了

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。