代码之家  ›  专栏  ›  技术社区  ›  Angulandy2

3个选项卡仅在一个选项卡中显示特定的html

  •  0
  • Angulandy2  · 技术社区  · 7 年前

    我用的是离子3个标签,我想要这个 <ion-fab> 只有在第一个选项卡中才能看到:

    HTML页:

    <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>
    
    1 回复  |  直到 7 年前
        1
  •  0
  •   Ravikumar R    7 年前
    export class TabsPage {
      // this tells the tabs component which Pages
      // should be each tab's root Page
      tab1Root = Page1;
      tab2Root = Page2;
      tab3Root = Page3;
    
      constructor() {
    
      }
    }
    

    如果你想显示ion fab Page1 只有你需要设置 <ion-fab></ion-fab> 标记 第1页 仅.html。