ionic5 angular路由 跳转并删除本页的历史记录
我们在ionic3中跳转到根页面是这样的:
this.navCtrl.setRoot(TabsPage);
这样就可以移除本页面的导航堆栈。但是,ionic4/5使用了路由,所以要跳转并移除本页的历史记录要这样:
this.router.navigate(['/error'], { replaceUrl: true });
在跳转路由时,向 router.navigate 添加可选参数 ”{ replaceUrl: true }“ 来移除本页面的历史记录,使安卓物理返回键无法回退到此页面。