特牛网址导航

TypeError: Cannot read property ‘setData‘ of undefined_typeerror: cannot read property 'setdata' of undef-CSDN博客

网友收藏
文章浏览阅读975次。在微信小程序中出现该错误TypeError: Cannot read property ‘setData’ of undefined**问题原因:**这是典型的this指代问题,因为此时的success是回调函数,回调函数this的指向回改变。解决方法:1、使用=>函数2、不推荐,除非是不能使用es6的语法在外定义let that = this..._typeerror: cannot read property 'setdata' of undefined