1***@qq.com
1***@qq.com
  • 发布:2023-10-12 01:41
  • 更新:2023-10-12 14:03
  • 阅读:740

【报Bug】vue3小程序中使用onShareAppMessage分享参数为空

分类:uni-app

产品分类: uniapp/小程序/微信

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: Windows 10 专业版

HBuilderX类型: 正式

HBuilderX版本号: 3.8.12

第三方开发者工具版本号: 1.06.2303220

基础库版本号: 3.0.0

项目创建方式: HBuilderX

示例代码:

<script>
export default {
data() {
return {
title: 'Hello'
}
},
onLoad(e) {
console.log(e)
},
methods: {
onShareAppMessage() {
return {
title: '转发给好友',
path: '/pages/index/index?id=123'
}
},
onShareTimeline(){
return {
title:"参数",
query:"id=123"
}
}
}
}
</script>

操作步骤:

用hbuider创建vue2和vue3,把代码示例放进去,vue2可以成功得到分享的参数,但是vue3分享参数获取是为空

预期结果:

{id:123}

实际结果:

{}

bug描述:

onShareTimeline,onShareAppMessage,这两个在vue3里都没有分享参数,
在点击右上角胶囊里的分享给好友及分享到朋友圈,携带参数分享为空,但是能成功分享出去

2023-10-12 01:41 负责人:无 分享
已邀请:
1***@qq.com

1***@qq.com (作者)

已解决,我的问题,vue3使用是 export default {
data() {
return {
title: 'Hello'
}
},
onLoad(e) {
console.log(e)
},
onShareAppMessage() {
return {
title: '转发给好友',
path: '/pages/index/index?id=122131233'
}
},
onShareTimeline(){
return {
title:"参数",
query:"id=123"
}
}
methods: {

    }  
}

要回复问题请先登录注册