本文介绍了带角6的离子4路由的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我目前正在尝试将旧版离子应用更新为v4,但似乎找不到与此导航相同的v4
return this.app.getRootNav().setPages([ {page: Profile}, {page: SettingsPage, params: {id: userId}} ])解决方案
Ionic4和您请求的角度版本如下:
this.router .navigate(["/page1"], { replaceUrl: true }) .then(() => this.router.navigate(["/page2"]));据我了解,逻辑在这里.将page1推入历史记录,但导航至page2,因此,如果用户按后退"按钮,它将重定向到page1. 这是 stackblitz 示例.
Im trying to update a legacy ionic app to v4 at the moment but cant seem to find a v4 equivalent to this navigation
return this.app.getRootNav().setPages([ {page: Profile}, {page: SettingsPage, params: {id: userId}} ])解决方案
Ionic4 and angular version of your request is like this :
this.router .navigate(["/page1"], { replaceUrl: true }) .then(() => this.router.navigate(["/page2"]));The logic is here as i understand. Push page1 into history but navigate to page2 so if user pushes the back button it redirects to page1. Here is the stackblitz sample.
更多推荐
带角6的离子4路由
发布评论