2019-09-28关于小程序this.setData无法账号函

2019-09-28  本文已影响0人  左子穆

VM1315:1 thirdScriptError
sett is not defined;at api request success callback function
ReferenceError: sett is not defined
at success (http://127.0.0.1:38477/appservice/page/list/list.js:64:9)
at Object.o.<computed> (WAService.js:1:1131034)
at WAService.js:1:453704
at MC (WAService.js:1:1091186)
at Function.success (WAService.js:1:1092853)
at WAService.js:1:102995
at C (WAService.js:1:437200)
at i.<anonymous> (WAService.js:1:705916)
at i.emit (WAService.js:1:462750)
at Ws (WAService.js:1:706524)

解决方案
函数中增加相应的临时变量存取this当前对象,至此可以后续回调函数中全局使用。
例如:
var self = this
使用
self.setData() 就可以正常使用。

参考案例:
https://www.qinziheng.com/xiaochengxudev/5791.htm

上一篇下一篇

猜你喜欢

热点阅读