问题描述
我正在开发使用onsenUI和堆栈导航到网页时面临这个问题的移动应用。
I'm developing mobile application using onsenUI and facing this problem when navigating to pages in stack.
当从第一页移动到第二页,我们通常使用 pushPage()
。
从第二页第一页,我们使用 popPage()
。但使用后退按钮,并从第二页第一页从第三页,第二页移动时,我收到
When moving from first page to second page, we normally use pushPage()
.From second page to first page, we use popPage()
. But when moving from third page to second page using back button and from second page to first page, I'm getting
Error: NavigatorView's page stack is empty
我试着用 resetToPage()
,但仍然收到此错误。
下面是我的尝试。
更新:
当从services.html导航到index.html的,我越来越控制台此错误。请检查。当我从第三页poppage第二页,然后第二页第一页,我收到提示导航视图页面堆栈是空的。
When navigating from services.html to index.html, I'm getting this error in console. Please check this. When I poppage from third page to second page, then second page to first page, I'm getting error as navigation view page stack is empty
推荐答案
< ONS-后退按钮>
已经执行popPage本身,所以没有必要做在里面NG-点击=myNavigator.popPage()
。有了它会试图删除从栈2页仅有1时,所以它警告说,页面堆栈尝试执行第二popPage空当。希望它能帮助!
<ons-back-button>
already perform a popPage itself, so there is no need to do ng-click="myNavigator.popPage()
in it. With that it will try to delete 2 pages from the stack when there is only 1, so it warns that the page stack is empty when trying to perform the second popPage. Hope it helps!
这篇关于错误:NavigatorView的页面堆栈是onsenui空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!