您的位置:首页 > 移动开发 > 微信开发

uni app 微信小程序分享

2020-06-07 05:21 761 查看

uni app 微信小程序分享

记录uni app 微信小程序的分享功能

分享只需要将注意按钮的open-type设置为share

另外取消button的样式

button:after {
border: none;
}
<button open-type="share">
<image src="../../static/link.png" ></image>
</button>

其次就是定义分享的onShareAppMessage
主要是title 分享的名字
path 分享的路径 可以带上参数 方便解析
imageUrl 分享图片的地址

onShareAppMessage(res) {
return {
title: `来自的分享`,
path: `/pages/index/index`,
imageUrl: 地址
}
}

菜鸟前端 多多指正

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: