JavaShuo
栏目
标签
微信小程序setData报错TypeError: Cannot read property ‘setData‘ of undefined的解决方案
时间 2020-12-29
原文
原文链接
今天写案例的时候,在onLoad函数中用this.setData重置了一个数值,然后就一直报错,结果如下: 问题的原因: 无法找到setData这个定义,因为setData中是onLoad函数中的方法中的子节点, 无法使用this 解决方案 这个时候需要在方法的开始部分定义var that = this,然后用that.setData来重置,这样就解决了这个问题了。 如下图:
>>阅读原文<<
相关文章
1.
微信小程序报Cannot read property 'setData' of undefined的错误
2.
微信小程序Cannot read property 'setData' of null错误
3.
react报错 TypeError: Cannot read property 'setState' of undefined
4.
× react报错:TypeError: Cannot read property ‘render‘ of undefined
5.
vue报错:"TypeError: Cannot read property 'forEach' of undefined"
6.
Vue.js报错—TypeError: Cannot read property 'Name' of undefined
7.
浏览器报Uncaught TypeError: Cannot read property 'trigger' of undefined解决方案
8.
微信小程序报错:Cannot read property ‘forceUpdate‘ of undefined
9.
微信小程序报错:Cannot read property ‘forceUpdate’ of undefined
10.
(已解决)TypeError: Cannot read property '_t' of undefined
更多相关文章...
•
SVN 解决冲突
-
SVN 教程
•
ASP Read 方法
-
ASP 教程
•
常用的分布式事务解决方案
•
PHP Ajax 跨域问题最佳解决方案
相关标签/搜索
setdata
解决方案
小程序报错
微信_小程序
微信小程序
解决方案 二
解决方案 七
typeerror
property
undefined
浏览器信息
Spring教程
NoSQL教程
教程
微服务
0
分享到微博
分享到微信
分享到QQ
每日一句
每一个你不满意的现在,都有一个你没有努力的曾经。
最新文章
1.
CVPR 2020 论文大盘点-光流篇
2.
Photoshop教程_ps中怎么载入图案?PS图案如何导入?
3.
org.pentaho.di.core.exception.KettleDatabaseException:Error occurred while trying to connect to the
4.
SonarQube Scanner execution execution Error --- Failed to upload report - 500: An error has occurred
5.
idea 导入源码包
6.
python学习 day2——基础学习
7.
3D将是页游市场新赛道?
8.
osg--交互
9.
OSG-交互
10.
Idea、spring boot 图片(pgn显示、jpg不显示)解决方案
本站公众号
欢迎关注本站公众号,获取更多信息
相关文章
1.
微信小程序报Cannot read property 'setData' of undefined的错误
2.
微信小程序Cannot read property 'setData' of null错误
3.
react报错 TypeError: Cannot read property 'setState' of undefined
4.
× react报错:TypeError: Cannot read property ‘render‘ of undefined
5.
vue报错:"TypeError: Cannot read property 'forEach' of undefined"
6.
Vue.js报错—TypeError: Cannot read property 'Name' of undefined
7.
浏览器报Uncaught TypeError: Cannot read property 'trigger' of undefined解决方案
8.
微信小程序报错:Cannot read property ‘forceUpdate‘ of undefined
9.
微信小程序报错:Cannot read property ‘forceUpdate’ of undefined
10.
(已解决)TypeError: Cannot read property '_t' of undefined
>>更多相关文章<<