Faizy Fazz
Faizy Fazz

Reputation: 35

Ionic tabs view

In my ionic project, I use ionic swipe tab, with three page. When I open the page the first page becomes visible on the page. I want the second page as selected when I open the page.

 <super-tabs style="height: 80%" [config]="{ sideMenu: 'left' }" [toolbarColor]="'primary'">
    <super-tab [root]="page1" [title]="showTitles? 'First page' : ''" [icon]="showIcons? 'home': ''"></super-tab>
    <super-tab [root]="page2" [title]="showTitles? 'Second page' : ''" [icon]="showIcons? 'pin' : ''"></super-tab>
    <super-tab [root]="page3" [title]="showTitles? 'Third page' : ''" [icon]="showIcons? 'heart' : ''"></super-tab>
  </super-tabs>

enter image description here

Upvotes: 0

Views: 126

Answers (1)

David
David

Reputation: 7507

If you have a look at the usage docs of the super-tabs project you will see that there is a selectedTabIndex input property which defaults to 0 if not provided which is why the first tab is selected on initialization. If you set it to 1 the second one will be selected:

 <super-tabs selectedTabIndex="1" style="height: 80%" [config]="...">

Upvotes: 1

Related Questions