个人案例
1、启动一个项目,在 app.js 中添加: [代码]onPageNotFound(e) {[代码][代码] [代码][代码]console.error([代码][代码]'onPageNotFound'[代码][代码], e)[代码][代码]}[代码] 2、然后随便添加一个不存在的路径,如下: [图片] 3、然后会出现下面的界面,但是没有触发 onPageNotFound 方法: [图片] [图片]
1909252 版本的开发工具无法触发 onPageNotFound ?比较新的的开发工具在启动设置中新增一个错误路径,不会触发 onPageNotFound,老版本的开发工具可以。 [代码]thirdScriptError[代码][代码]onPageNotFound error: page [代码][代码]"health-info"[代码] [代码]is not found.; at onPageNotFound[代码][代码]Error: onPageNotFound error: page [代码][代码]"health-info"[代码] [代码]is not found.[代码][代码] [代码][代码]at WAService.js:1:872524[代码][代码] [代码][代码]at WAService.js:1:458059[代码][代码] [代码][代码]at n (http:[代码][代码]//127.0.0.1:47787/appservice/__dev__/asdebug.js:1:3175)[代码][代码] [代码][代码]at e.exports.<anonymous> (http:[代码][代码]//127.0.0.1:47787/appservice/__dev__/asdebug.js:1:3555)[代码][代码] [代码][代码]at http:[代码][代码]//127.0.0.1:47787/appservice/__dev__/asdebug.js:1:1968[代码][代码] [代码][代码]at Array.forEach (<anonymous>)[代码][代码] [代码][代码]at WebSocket._ws.onmessage (http:[代码][代码]//127.0.0.1:47787/appservice/__dev__/asdebug.js:1:1950)[代码]Page "health-info" has not been registered yet. 并没有我在onPageNotFound 中打印的log信息
2019-09-27