为什么明明数组有_id,后台输出的时候报错?

发布于 8 年前作者 chaozhou2271 次浏览最后编辑 8 年前来自 issues

难道不能

that.data.userData[0]._id 吗

他就报错了

Cannot read property ‘_id’ of undefined; [Component] Event Handler Error @ pages/login/login#bound bindGetUserInfo

TypeError: Cannot read property ‘_id’ of undefined

2 回复
yan07
yan071 楼6 年前

碰到这种情况,当然是从下往上一级级log出来看:

that.data.userData[0]

that.data.userData

that.data

yansun
yansun2 楼6 年前

相关代码贴一下,login页面.