问题截图如下
image.png问题代码如下
loginAct: () => {
console.log("执行了");
var that = this;
wx.getStorage({
key: 'user',
success: function (res) {
console.log("信息数据res为", res);
that.setData({
userInfo: res.data,
}, () => {
console.log("重新刷新数据");
})
}
})
}
解决办法:loginAct: () => {}
改成loginAct(){}
loginAct(){
console.log("执行了");
var that = this;
wx.getStorage({
key: 'user',
success: function (res) {
console.log("信息数据res为", res);
that.setData({
userInfo: res.data,
}, () => {
console.log("重新刷新数据");
})
}
})
}
网友评论