请选择 进入手机版 | 继续访问电脑版
 找回密码
 立即注册
搜索

开发问题 动态设置titleBar,按返回之后报错

2
回复
1263
查看
[复制链接]

1

主题

2

帖子

15

积分

 楼主| 2020-11-18 10:34:02 显示全部楼层 |阅读模式
本帖最后由 月亮邮递员 于 2020-11-18 10:35 编辑 this.$page.setTitleBar({ text: this.title }); web.js:1 Uncaught TypeError: Cannot read property 'titlebar' of undefined at web.js:1 at Object.navigateTo (web.js:1) at web.js:1 (anonymous) @ web.js:1 navigateTo @ web.js:1 (anonymous) @ web.js:1 electron/js2c/renderer_init.js:114 Uncaught TypeError: r.process.listenerCount is not a function at window.onerror (electron/js2c/renderer_init.js:114) 在onInit钩子里设置了titleBarText 然而重这个页面返回的时候确报了这个错,页面一片空白,再按一次返回才能回到之前的页面。 代码中并没操作 'titlebar' 这个属性
回复

使用道具 举报

1

主题

2

帖子

15

积分

 楼主| 2020-11-18 17:38:06 显示全部楼层
本帖最后由 月亮邮递员 于 2020-11-18 17:39 编辑 ### App Framework ### 创建页面 26----应用Id: 1 web.js:1 [sitemap info] setTitleBar 设置的title为: 关于我们 web.js:1 ### App Framework ### 启动页面---- @app-component/index ### App Framework ### 销毁页面(26)---- 正常情况下,打开一个页面会创建一个页面,返回的时候会销毁这个页面。 然后我打开一个页面的时候却创建了两个页面栈,到时后退的时候报错 ### App Framework ### 创建页面 28----应用Id: 1 web.js:1 ### App Framework ### 创建页面 29----应用Id: 1 web.js:1 ### App Framework ### 启动页面---- @app-component/index web.js:1 Uncaught TypeError: Cannot read property 'titlebar' of undefined at web.js:1 at Object.navigateTo (web.js:1) at web.js:1 (anonymous) @ web.js:1 navigateTo @ web.js:1 (anonymous) @ web.js:1 electron/js2c/renderer_init.js:114 Uncaught TypeError: r.process.listenerCount is not a function at window.onerror (electron/js2c/renderer_init.js:114) window.onerror @ electron/js2c/renderer_init.js:114 web.js:1 Uncaught TypeError: Cannot read property '_callbacks' of undefined at en (web.js:1) at setTimeout (web.js:1) at HTMLHtmlElement. (web.js:40) en @ web.js:1 setTimeout @ web.js:1 (anonymous) @ web.js:40 electron/js2c/renderer_init.js:114 Uncaught TypeError: r.process.listenerCount is not a function at window.onerror (electron/js2c/renderer_init.js:114) window.onerror @ electron/js2c/renderer_init.js:114 web.js:1 Error: Runtime changeVisiblePage:无效页面Id: "29" u.error @ web.js:1 global. @ web.js:1 navigateTo @ web.js:1 (anonymous) @ web.js:1 web.js:1 Error: Runtime destroyPage:无效页面Id: "29" 这是什么原因?什么时候会创建两个页面栈?

点评

两次创建是正常现象,这个是开发调试中会出现的。线上快应用不会出现这个问题。  详情 回复 发表于 2020-12-8 11:21
回复

使用道具 举报

2020-12-8 11:21:54 显示全部楼层
月亮邮递员 发表于 2020-11-18 17:38 ### App Framework ### 创建页面 26----应用Id: 1 web.js:1 [sitemap info] setTitleBar 设置的title为: 关 ...
两次创建是正常现象,这个是开发调试中会出现的。线上快应用不会出现这个问题。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册