小程序填坑--TypeError: this.setData is not a function

 this关键字,不能直接在请求的回调函数里写this,应该在请求外声明一个变量,接收onload函数的this,这样就不会报错了

或者尝试使用ES6的箭头函数

 

posted @ 2018-05-11 16:29  烟蓑雨笠卷单行  阅读(1089)  评论(0编辑  收藏  举报