使用wx.reques获取网站内容使用setData不能对数据赋值?
发布于 6 年前 作者 ghe 5246 次浏览 来自 官方Issues

jlchassis: function() {

var _this = this;

wx.request({

url: 'https://localhost:44360/home/index',

header: {

'Content-Type': 'application/json'

},

success: function(e1) {

console.log(e1.data)

_this.setData({

start_address: e1.data

})

}

})

}

用console.log(start_address)显示未定义

1 回复

e1.data是有数据的我用console.log(e1.data)可以看到数据

回到顶部