在页面onLoad后
conlog.log(app)
结果为
但是如果
console.log(app.globalData.userInfo)
就成了 undefined
是我写错了吗?
应该是onLoad先于app里面的函数执行导致的 应该就是楼上说的异步
这是异步的问题吧!!