exist: function (e) {
db = wx.cloud.database()
db.collection("test").get(
{
success: function(res){
console.log(0)
this.setData({
text:1
}, function(){
console.log("that.data.text")
})
console.log(1)
}
}
)
}
最后输出只输出0,其他的啥也不输出
exist: function (e) { db = wx.cloud.database() db.collection("test").get( { success: (res) => { this.setData({ text: 1 }) } }) }