所有组合中的主排气口和辅助排气口中的两个组件

问题描述

假设我希望这些路线有效:

// '/pageA' with empty auxiliary outlet
this.router.navigate([{outlets: { primary: 'pageA' } } ] );

// '/pageA' with '/pageB' in the auxiliary outlet
this.router.navigate([{outlets: { primary: 'pageA',secondaryOutlet: 'pageB' } } ] );

// '/pageB' with empty auxiliary outlet
this.router.navigate([{outlets: { primary: 'pageB' } } ] );

// '/pageB' with '/pageA' in the auxiliary outlet
this.router.navigate([{outlets: { primary: 'pageB',secondaryOutlet: 'pageA' } } ] );

我的app.component.html:


<router-outlet></router-outlet>
<router-outlet name="secondaryOutlet"></router-outlet>

我的app-routing.module.ts:

{
    path: 'pageA',component: PageAComponent,},{
    path: 'pageB',component: PageBComponent,

要进行这项工作,我需要更改什么?在app-routing.module.ts中指定“ secondaryOutlet”?用哪种方式,因为pageA和pageB必须能够位于主电源插座和辅助电源插座中。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)