Angular 从子路由返回时未触发导航挂钩4
我有一个Ionic应用程序,我必须从我的Angular 从子路由返回时未触发导航挂钩4,angular,ionic4,Angular,Ionic4,我有一个Ionic应用程序,我必须从我的/tabs/cart页面导航到/address页面。 然后在地址页面中执行一些操作后,我将导航到购物车页面/tabs/cart导航工作正常,但导航挂钩(IonViewDiCenter)未触发的问题,我尝试在线找到解决方案,但没有任何效果 this.router.navigate(['/address'], { queryParams: {} }); this.router.navigate(['/tabs/cart'], {
/tabs/cart
页面导航到/address
页面。
然后在地址页面中执行一些操作后,我将导航到购物车页面/tabs/cart
导航工作正常,但导航挂钩(IonViewDiCenter)未触发的问题,我尝试在线找到解决方案,但没有任何效果
this.router.navigate(['/address'], {
queryParams: {}
});
this.router.navigate(['/tabs/cart'], {
queryParams: {
flow: "fromAddressPage"
}
});
以下是应用程序和选项卡模块的路由器
{ path: 'address', loadChildren: './address/address.module#AddressPageModule' }
{
path: 'cart',
children: [
{
path: '',
loadChildren: () =>
import('../cart/cart.module').then(m => m.CartPageModule)
}
]
},
尝试使用ionViewWillEnter在页面激活之前触发哪个。如果该选项不起作用,则不会触发任何导航挂钩。根据此选项,只有在页面之间切换时才会触发挂钩,而不会使用Tabs switch触发挂钩。