为什么我打印log赋值后的提示未定义?
getdata(){
let that=this
wx.cloud.callFunction({
name:"callback",
success(res){console.log("request success",res);
that.setData({
datalist:res.result.data
})
},
fail(res){console.log("request success",res)}
})
console.log(datalist)
},
代码console.log(datalist)提示ReferenceError: datalist is not defined
success(res){console.log("request success",res);这个执行成功了