带角6的离子4路由

编程入门 行业动态 更新时间:2024-10-18 01:34:13
本文介绍了带角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路由

本文发布于:2023-10-31 13:21:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546205.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:路由   离子

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!