Cannot read property 'apply' of null;at page XXX onShareAppMessage function

然后看了下自己的代码,分享按钮在子组件里, at page XXX , XXX是自己组件的父级,

也就是说 onShareAppMessage() 分享函数,不能再子组件去触发父级的分享。。。

把 onShareAppMessage 放在父级就好啦

参考链接:https://blog.csdn.net/gwdgwd123/article/details/82660260

小程序分享报错 Cannot read property 'apply' of null;at page XXX onShareAppMessage function的更多相关文章

  1. 微信小程序--分享报错(thirdScriptError Cannot read property 'from' of undefined;at pages/index/index page onShareAppMessage function TypeError: Cannot read property 'from' of undefined)

    分享功能: onShareAppMessage: function (res) { if (res.from === 'button') { // 来自页面内转发按钮 console.log(res. ...

  2. js执行函数报错Cannot set property 'value' of null怎么解决?

    js执行函数报错Cannot set property 'value' of null 的解决方案: 原因:dom还没有完全加载 第一步:所以js建议放在body下面执行, 第二步:window.on ...

  3. hexo 报错 Cannot read property 'replace' of null

    详细错误信息: FATAL Cannot read property 'replace' of null TypeError: Cannot read property 'replace' of nu ...

  4. wepy开发小程序eslint报错error 'getApp' is not defined no-undef

    wepy开发小程序使用getApp().globalData保存全局数据很方便,但是会在控制台看到很多报错:“error 'getApp' is not defined no-undef”,这是esl ...

  5. 小程序运行报错:errMsg: "request:fail url not in domain list"

    错误原因: 报错提示说请求的url不在域名列表里,应该是还没有配置服务器域名 解决方法: 可点击开发者工具右上角 详情-项目设置-不校验合法域名.web-view(业务域名).TLS 版本以及 HTT ...

  6. 微信小程序地图报错——ret is not defined

    刚刚在使用微信的map做地图时候 发现如下报错: 后来找了一会发现错误为经纬度写反了导致经纬度超出了范围 正确取值范围: latitude   纬度  浮点数,范围 -90 ~ 90 longitud ...

  7. 微信小程序:报错fail webview count limit exceed

    报错: 分析原因: 先从列表页面跳转到详细页面时,使用了Navigator标签,open-type默认使用的navigate,跳转时会保留当前页, <navigator class=" ...

  8. 报错”Cannot read property 'addEventListener' of null“

    1.报错:Cannot read property 'addEventListener' of null 2.解决方案: 把代码放到window.onload=function(){...}里面,因为 ...

  9. echarts js报错 Cannot read property 'getAttribute' of null

    本文将为您描述如何解决 eharts.js报错 Uncaught TypeError: Cannot read property 'getAttribute' of null 的问题 根据报错信息查找 ...

随机推荐

  1. Linux命令:iostat命令

    Linux系统中的 iostat是I/O statistics(输入/输出统计)的缩写,iostat工具将对系统的磁盘操作活动进行监视.它的特点是汇报磁盘活动统计情况,同时也会汇报出CPU使用情况.同 ...

  2. Android音频录制MediaRecorder之简易的录音软件实现代码(转)

    原文:http://www.jb51.net/article/46182.htm Android音频录制MediaRecorder之简易的录音软件实现代码 这篇文章主要介绍了Android音频录制Me ...

  3. 深浅copy浅析

    Python代码在开始执行的时候,代码会被系统从硬盘调入内存,等候CPU执行,至于怎么个调入逻辑,还不清楚. 在高级语言中,变量是对内存及其地址的抽象.也就是说变量就是内存地址. 那么我们先来介绍两种 ...

  4. 「luogu2633」Count on a tree

    「luogu2633」Count on a tree 传送门 树上主席树板子. 每个节点的根从其父节点更新得到,查询的时候差分一下就好了. 参考代码: #include <algorithm&g ...

  5. 本周总结(19年暑假)—— Part2

    日期:2019.7.21 博客期:108 星期日 这几天正在认真学习大数据,我是在B站上看尚老师的视频搞得.我已经配好了Hadoop的基本环境,现在学习的是HDFS的相关内容

  6. unity优化-CPU(网上整理)

    CPU方面性能考虑:引擎和代码渲染模块.动画模块.物理模块.ui模块.粒子模块.加载模块.GC模块最重要的是渲染模块.UI模块和加载模块1.渲染模块主要是:场景.物体和特效的渲染a.降低Draw ca ...

  7. Law of large numbers and Central limit theorem

    大数定律 Law of large numbers (LLN) 虽然名字是 Law,但其实是严格证明过的 Theorem weak law of large number (Khinchin's la ...

  8. java并发队列

    阻塞队列 常见的阻塞队列有ArrayBlockingQueue,LinkedBlockingDeque,LinkedBlockingQueue,这些队列有界且可以阻塞线程 ArrayBlockingQ ...

  9. 解题报告:luogu P1144 最短路计数

    题目链接:P1144 最短路计数 很简单的一道\(dfs\),然而我又跑了一遍\(dij\)和排序,时间复杂度是\(O(nlog n)\) 注意:\(1\).搜索时向\(dis[j]=dis[cur] ...

  10. java中将图片上传到配置好的ftp服务器上

    测试用例: @Test public void testFtp() throws Exception { //1.连接ftp服务器 FTPClient ftpClient = new FTPClien ...