微信小程序 this.setData is not a function
var that = this;
wx.request({
url: 'http://52.214.109.210:5000/news?offset=0&limit=10', //仅为示例,并非真实的接口地址
data: {
x: '',
y: ''
},
header: {
'content-type': 'application/json'
},
success: function (res) {
console.log(res.data.results);
that.setData({
ajaxdata: res.data.results
})
wx.showToast({
title: '成功',
icon: 'success',
duration: 2000
})
}
})
小程序的一般函数中
bindFaChange1: function