需求:在自定义组件中有一个分享按钮,小程序onShareAppMessage不能在组件中展示自定义内容
解决方法: 在组件的button中设置分享自定义内容

组件中设置完成后在使用组件的page页面的js中写调用方法 onShareAppMessage:function(res){
let share = res.target.dataset.share;//在组件中自定义的值就通过button传出来
return {
title: share.title,
path: share.path,
imageUrl: share.imageUrl
}
}
这样就通过button传递出数据,在page中使用了
