通过onShareAppMessage方法分享出去没有标题,通过右上角分享出去有标题
代码如下:
<button bindtap='onShareAppMessage' open-type="share">转发给好友</button>
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
网友回复
心心情:
标题需要在分享事件onShareAppMessage()定义的。目前没有配置标题的话,点击右上角“转发”分享标题默认是小程序名称,页面按钮分享是空,是不一致的。
默认²⁰²⁰:
写下面的代码就有了
卡布达:
手动添加title试试?
onShareAppMessage: function () {
return {
title: "",
path: ""
}
}
citizen four:
onShareAppMessage:function() {
return {
title: '分享标题',
imageUrl: '分享图片',
path: "分享路径"
};
},