官方微信小程序分享文档
官方uni小程序分享转发文档
<template>
<view class="content">
<button type="default" open-type="share">wx分享</button>
</view>
</template>
<script>
export default {
data() {
return {}
},
onLoad() {},
onShareAppMessage: function(res) {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline'],
// shareAppMessage是分享给好友;shareTimeline分享至朋友圈
})
if (res.from === 'button') {
// from-button来自页面内转发按钮;
console.log(res.target)
}
return {
title: '分享',
path: '/pages/index/index'
}
},
methods: {
}
}
</script>