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

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

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

猜你喜欢

转载自www.cnblogs.com/luowBlog/p/9025360.html