嗨,我试图添加两个子页面在两个标签页在离子4使用下面的代码,但我感到困惑的是不显示管理员与两个选项卡,当我选择标签,各自的网页必须显示,但它直接显示儿童1页
我想知道我什么时候用它工作很好,请给我推荐一个我哪里做错了?
HTML
<ion-content padding>
<ion-row>
<ion-col col-4><button ion-button color="secondary" (click)="child1()">Child1</button></ion-col>
<ion-col col-4><button ion-button color="secondary" (click)="child2()">Child2</button></ion-col>
</ion-row>
<ion-router-outlet></ion-router-outlet>
</ion-content>
管理路由器.module.ts
const routes: Routes = [
{
path: 'Admin',
component: AdminPage,
children: [
{ path: '',redirectTo: '/Admin/Child1',pathMatch: 'full'},
{ path: 'Child1', component: Child1Page },
{ path: 'Child2', component: Child2Page },
]
}
];
管理模块.ts
@NgModule({
imports: [
CommonModule,
IonicModule,
AdminRoutingModule
],
declarations: [
AdminPage,
Child1Page,
Child2Page
]
})
export class AdminModule {
}