获取系统信息的API调用(wx.getSystemInfo)是不是异步的?
发布于 6 年前 作者 bgong 848 次浏览 来自 问答

获取系统信息的API调用有两个:wx.getSystemInfo,wx.getSystemInfoSync。我理解第一个是异步的、第二个是同步的,
异步是回调方式的,但实际测试好像不是:

console.log('step1')
wx.getSystemInfo({ success: function(){console.log('step31')}, fail: function(){console.log('step32')} })
console.log('step2')
 
//预期打印结果是:
step1
step2
step31
 
 
//实际打印结果是:
step1
step31
step2
 
 
//是我理解的不对么?
回到顶部