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.
深度学习硬件架构简述
2.
重温矩阵(V) 主成份分析
3.
国庆佳节第四天,谈谈我月收入增加 4K 的故事
4.
一起学nRF51xx 23 - s130蓝牙API介绍
5.
2018最为紧缺的十大岗位,技术岗占80%
6.
第一次hibernate
7.
SSM项目后期添加数据权限设计
8.
人机交互期末复习
9.
现在无法开始异步操作。异步操作只能在异步处理程序或模块中开始,或在页生存期中的特定事件过程中开始...
10.
微信小程序开发常用元素总结1-1
本站公众号
欢迎关注本站公众号,获取更多信息
相关文章
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
>>更多相关文章<<