uniapp 微信小程序调用微信云开发服务器返回的数据如何赋值给data 变量?
data(){
return{
rentlists="13123"
}
}
created(){
const db = wx.cloud.database()
db.collection('myRent').where({
type: 'info'
}).get({
success: function(res) {
let that=this
console.log(that.rentlists); // undefined? 预期应该是rentlists="13123"
// 输出 [{ "title": "The Catcher in the Rye", ... }]
that.rentlists=res.data; //能接收到数据、
console.log(that.rentlists) //此时res.data的确赋值给rentlists 但这个rentlists似乎不是上方data中的rentlists?
}
})
},