效果图:
<template>
<button class="buttonBox posAbsolute" open-type="share">分享按钮</button>
</template>
wx.showShareMenu({
menus: ['shareAppMessage', 'shareTimeline']
});
//转发给朋友
onShareAppMessage(res) {
return {
title: "分享标题",
path: "这是打开后的跳转路径", //这是打开后的跳转路径
imageUrl: "分享图片"
}
},
//转发朋友圈
onShareTimeline(res) {
return {
title: "分享标题",
path: "这是打开后的跳转路径", //这是打开后的跳转路径
imageUrl: "分享图片"
}
},