在wxml页面使用以下的定位授权,点击按钮后,直接报以下错误,请问是为什么?
<button class="locationBtn" open-type="openSetting" hidden='{{openSetting}}' bindopensetting="getWxLocation">点击获取位置信息</button>
VM3154:1 appServiceSDKScriptError
Cannot read property 'mode' of undefined;at api onAppEnterBackground callback function
TypeError: Cannot read property 'mode' of undefined
at Bt.<anonymous> (http://127.0.0.1:49560/appservice/__dev__/WAService.js:1:525987)
at Bt.emit (http://127.0.0.1:49560/appservice/__dev__/WAService.js:1:305615)
at Object.emit (http://127.0.0.1:49560/appservice/__dev__/WAService.js:1:324480)
at Bt.<anonymous> (http://127.0.0.1:49560/appservice/__dev__/WAService.js:1:330528)
at Bt.emit (http://127.0.0.1:49560/appservice/__dev__/WAService.js:1:305657)
at Object.emit (http://127.0.0.1:49560/appservice/__dev__/WAService.js:1:324480)
at http://127.0.0.1:49560/appservice/__dev__/WAService.js:1:325658
at http://127.0.0.1:49560/appservice/__dev__/WAService.js:1:262652
at e (http://127.0.0.1:49560/appservice/appservice?t=1547536492677:1205:2640)
at n.registerCallback.t (http://127.0.0.1:49560/appservice/appservice?t=1547536492677:1205:2903)
嗯,开发者工具在 v2.4.4 和 v2.5.0 的基础库中只要发生切后台的行为,都会产生这个错误。真机上不会产生这个错误。
我们会在下个基础库版本中进行修复。
好的