How can i insert page in ionic 3 segment layout

2019-08-07 02:38发布

This is my app with Tabs layout

enter image description here

Once i click on profile tab i push a page say Profile.ts which contains ion-segment in its own template Profile.html

Profile.html

<ion-content>
  <ion-segment [(ngModel)]="whichPage" color="primary">
  <ion-segment-button style="font-size: 11px" value="Personal">
    Personal
  </ion-segment-button>
</ion-segment>

<div [ngSwitch]="whichPage">
 <ion-list *ngSwitchCase="'Personal'">
 <ion-item>
   **HERE HOW CAN I DISPLAY ANOTHER PAGE WHICH I HAVE CREATED USING IONIC 
   GENERATE PAGE Personal**
 </ion-item>
</div>
</ion-content>

1条回答
混吃等死
2楼-- · 2019-08-07 03:04

You wont be able to display an entire page but you can set a component. This is because a particular page can only have one ion-content tag.

You will have to remove the header, footer and content parent tags from profile. You can have the profile content within Profile.html. and then use it within your segment as a Child component as:

<ion-list *ngSwitchCase="'Personal'">
 <ion-item>
   <PersonalComponent></PersonalComponent>
 </ion-item>
</ion-list>
查看更多
登录 后发表回答