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.
NLP《詞彙表示方法(六)ELMO》
2.
必看!RDS 數據庫入門一本通(附網盤鏈接)
3.
阿里雲1C2G虛擬機【99/年】羊毛黨集合啦!
4.
10秒鐘的Cat 6A網線認證儀_DSX2-5000 CH
5.
074《從零開始學Python網絡爬蟲》小記
6.
實例12--會動的地圖
7.
聽薦 | 「談笑風聲」,一次投資圈的嘗試
8.
阿里技術官手寫800多頁PDF總結《精通Java Web整合開發》
9.
設計模式之☞狀態模式實戰
本站公眾號
歡迎關注本站公眾號,獲取更多信息
相關文章
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
>>更多相關文章<<