闫明
闫明
  • 发布:2019-01-22 10:14
  • 更新:2020-01-02 15:42
  • 阅读:5771

uniapp onShareAppMessage 报错

分类:uni-app

Cannot read property 'apply' of null;

2019-01-22 10:14 1 条评论 负责人:无 分享
已邀请:

最佳回复

闫明

闫明 (作者)

已经解决了 onShareAppMessage需要放到methods外面

虫雪浓

虫雪浓 - 热爱生活,热爱编程

请提供相关错误代码,如果能附一个可以 复现问题的简单demo是最好的,方便我们定位问题。

the_wolf_life

the_wolf_life - 大前端领航者

可以介绍下onShareAppMessage 怎么使用吗 按照官方使用流程没有生效
代码如下
<button open-type="share" >分享</button>

onShareAppMessage(res) {
console.log(res)
if (res.from === 'button') {// 来自页面内分享按钮
console.log(res.target)
}
return {
title: '标题',
path: “路径” ,
success(resp){
console.log(resp)
}
}
},

  • 9***@qq.com

    请问解决了吗?我也遇到了这个问题

    2020-09-02 13:48

aiplat点com

aiplat点com - aiplat.com

typescript版本的也是报这个错,可以分享出去,但是onShareAppMessage里面的代码不执行

aiplat点com

aiplat点com - aiplat.com

https://ask.dcloud.net.cn/question/85921?column=log&rf=false

typescript版本的也是报这个错,可以分享出去,但是onShareAppMessage里面的代码不执行

该问题目前已经被锁定, 无法添加新回复