设置一个事件,用来测试
用类似于vue中的this.msg = result.data[1].receiver并不能把值传出去
但是用setData却可以,代码如下
btnclick:function(){
var that = this;
wx.request({
url: 'http://www.k1998.xyz/kjh/reciever.php',
success: (result) => {
console.log(result.data);
//this.msg = result.data[1].receiver;
//console.log(this.msg);
that.setData({
msg:result.data[1].receiver
})
}
});
}