我正在使用Ionic 3标签,并且我希望仅在第一个标签中看到此<ion-fab>
:
HTML PAGE:
<ion-tabs>
<ion-tab [root]="tab1Root"></ion-tab> //first tab
<ion-tab [root]="tab2Root"></ion-tab>
<ion-tab [root]="tab3Root"></ion-tab>
</ion-tabs>
//Show this only if first tab :
<ion-fab ngif="tabIndex = 0"></ion-fab>
答案 0 :(得分:0)
export class TabsPage {
// this tells the tabs component which Pages
// should be each tab's root Page
tab1Root = Page1;
tab2Root = Page2;
tab3Root = Page3;
constructor() {
}
}
如果您只想在Page1
上显示ion-fab,则只需设置
仅<ion-fab></ion-fab>
.html中的Page1
标记。