mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
house of pane
This commit is contained in:
@@ -43,7 +43,6 @@ import {IonicComponent} from 'ionic/config/component';
|
||||
export class Tab {
|
||||
constructor(
|
||||
@Parent() tabs: Tabs,
|
||||
@Optional() parentNavBase: NavBase,
|
||||
compiler: Compiler,
|
||||
elementRef: ElementRef,
|
||||
loader: DynamicComponentLoader,
|
||||
@@ -51,13 +50,12 @@ export class Tab {
|
||||
viewContainerRef: ViewContainerRef
|
||||
) {
|
||||
|
||||
this.navBase = new NavBase(parentNavBase, compiler, elementRef, loader, injector);
|
||||
this.parentNavBase = parentNavBase;
|
||||
if (parentNavBase) {
|
||||
this.sections = parentNavBase.panes['_n'].sections;
|
||||
this.navBase = new NavBase(tabs.navBase, compiler, elementRef, loader, injector);
|
||||
if (tabs.navBase.parent) {
|
||||
this.sections = tabs.navBase.parent.panes['_n'].sections;
|
||||
}
|
||||
|
||||
this.item = new NavItem(parentNavBase);
|
||||
this.item = new NavItem(this.navBase);
|
||||
this.item.setInstance(this);
|
||||
this.item.setViewElement(elementRef.domElement);
|
||||
tabs.add(this.item);
|
||||
|
||||
@@ -13,7 +13,6 @@ import {IonicComponent} from '../../config/component';
|
||||
import {Tab} from './tab';
|
||||
import {TabButton} from './tab-button';
|
||||
import {Icon} from '../icon/icon';
|
||||
import {Nav, NavPane} from '../nav/nav';
|
||||
import {NavItem} from '../nav/nav-item';
|
||||
import {NavBase} from '../nav/nav-base';
|
||||
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
|
||||
<ion-nav [initial]="initial">
|
||||
</ion-nav>
|
||||
<ion-nav [initial]="initial"></ion-nav>
|
||||
|
||||
@@ -1,16 +1,8 @@
|
||||
|
||||
<ion-tabs>
|
||||
|
||||
<ion-tab [initial]="tab1Initial" tab-title="Tab 1" tab-icon="ion-home">
|
||||
</ion-tab>
|
||||
<ion-tab [initial]="tab1Initial" tab-title="Tab 1" tab-icon="ion-home"></ion-tab>
|
||||
|
||||
<ion-tab [initial]="tab2Initial" tab-title="Tab 2" tab-icon="ion-star" class="tab2">
|
||||
</ion-tab>
|
||||
<ion-tab [initial]="tab2Initial" tab-title="Tab 2" tab-icon="ion-star" class="tab2"></ion-tab>
|
||||
|
||||
</ion-tabs>
|
||||
|
||||
<style>
|
||||
.tab2 f {
|
||||
background: green
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user