mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
tabs
This commit is contained in:
@ -2,7 +2,9 @@
|
|||||||
// Android Toolbar
|
// Android Toolbar
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
$tab-bar-android-item-padding: 4px 10px !default;
|
$tab-bar-android-item-padding: 4px 10px !default;
|
||||||
|
$tab-bar-android-active-border-width: 3px !default;
|
||||||
|
$tab-bar-android-active-border-color: red !default;
|
||||||
|
|
||||||
|
|
||||||
.tabs-android {
|
.tabs-android {
|
||||||
@ -11,4 +13,12 @@ $tab-bar-android-item-padding: 4px 10px !default;
|
|||||||
padding: $tab-bar-item-padding;
|
padding: $tab-bar-item-padding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tab-bar .tab-bar-item {
|
||||||
|
border-bottom: $tab-bar-android-active-border-width solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-bar .tab-active {
|
||||||
|
border-bottom-color: $tab-bar-android-active-border-color;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
$tab-bar-ios-item-padding: 3px 10px !default;
|
$tab-bar-ios-item-padding: 3px 10px !default;
|
||||||
$tab-bar-ios-item-font-size: 11px !default;
|
$tab-bar-ios-item-font-size: 1.1rem !default;
|
||||||
$tab-bar-ios-item-icon-size: 28px !default;
|
$tab-bar-ios-item-icon-size: 2.8rem !default;
|
||||||
|
|
||||||
|
|
||||||
.tabs-ios {
|
.tabs-ios {
|
||||||
@ -25,4 +25,8 @@ $tab-bar-ios-item-icon-size: 28px !default;
|
|||||||
@include hairline(top, $toolbar-ios-border-color);
|
@include hairline(top, $toolbar-ios-border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
> .tab-bar.toolbar-top {
|
||||||
|
@include hairline(bottom, $toolbar-ios-border-color);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -22,16 +22,20 @@ import {IonicComponent} from 'ionic2/config/component'
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<content></content>
|
<div class="pane-container tabs-container">
|
||||||
|
<content></content>
|
||||||
|
</div>
|
||||||
`,
|
`,
|
||||||
directives: [For]
|
directives: [For]
|
||||||
})
|
})
|
||||||
export class Tabs {
|
export class Tabs {
|
||||||
constructor(
|
constructor(
|
||||||
element: NgElement
|
@NgElement() ngElement: NgElement
|
||||||
) {
|
) {
|
||||||
this.domElement = element.domElement
|
this.domElement = ngElement.domElement
|
||||||
|
|
||||||
this.domElement.classList.add('pane')
|
this.domElement.classList.add('pane')
|
||||||
|
|
||||||
this.config = Tabs.config.invoke(this)
|
this.config = Tabs.config.invoke(this)
|
||||||
|
|
||||||
this.tabs = []
|
this.tabs = []
|
||||||
|
1
src/components/tabs/test/tab-bar-bottom/e2e.js
Normal file
1
src/components/tabs/test/tab-bar-bottom/e2e.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
20
src/components/tabs/test/tab-bar-bottom/main.html
Normal file
20
src/components/tabs/test/tab-bar-bottom/main.html
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
<ion-view>
|
||||||
|
|
||||||
|
<ion-tabs placement="bottom">
|
||||||
|
|
||||||
|
<ion-tab tab-title="Tab 1">
|
||||||
|
<ion-view>
|
||||||
|
Tab 1 Content
|
||||||
|
</ion-view>
|
||||||
|
</ion-tab>
|
||||||
|
|
||||||
|
<ion-tab tab-title="Tab 2">
|
||||||
|
<ion-view>
|
||||||
|
Tab 2 Content
|
||||||
|
</ion-view>
|
||||||
|
</ion-tab>
|
||||||
|
|
||||||
|
</ion-tabs>
|
||||||
|
|
||||||
|
</ion-view>
|
17
src/components/tabs/test/tab-bar-bottom/main.js
Normal file
17
src/components/tabs/test/tab-bar-bottom/main.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import {bootstrap} from 'angular2/core';
|
||||||
|
import {Component, Template} from 'angular2/angular2';
|
||||||
|
import {View, Tabs, Tab} from 'ionic2/components';
|
||||||
|
|
||||||
|
|
||||||
|
@Component({ selector: '[ion-app]' })
|
||||||
|
@Template({
|
||||||
|
url: 'main.html',
|
||||||
|
directives: [View, Tabs, Tab]
|
||||||
|
})
|
||||||
|
class IonicApp {
|
||||||
|
constructor() {
|
||||||
|
console.log('IonicApp Start')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bootstrap(IonicApp)
|
1
src/components/tabs/test/tab-bar-top/e2e.js
Normal file
1
src/components/tabs/test/tab-bar-top/e2e.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
16
src/components/tabs/test/tab-bar-top/main.html
Normal file
16
src/components/tabs/test/tab-bar-top/main.html
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
<ion-tabs placement="top">
|
||||||
|
|
||||||
|
<ion-tab tab-title="Tab 1">
|
||||||
|
<ion-view nav-title="Tab 1">
|
||||||
|
Tab 1 Content
|
||||||
|
</ion-view>
|
||||||
|
</ion-tab>
|
||||||
|
|
||||||
|
<ion-tab tab-title="Tab 2">
|
||||||
|
<ion-view nav-title="Tab 2">
|
||||||
|
Tab 2 Content
|
||||||
|
</ion-view>
|
||||||
|
</ion-tab>
|
||||||
|
|
||||||
|
</ion-tabs>
|
17
src/components/tabs/test/tab-bar-top/main.js
Normal file
17
src/components/tabs/test/tab-bar-top/main.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import {bootstrap} from 'angular2/core';
|
||||||
|
import {Component, Template} from 'angular2/angular2';
|
||||||
|
import {View, Tabs, Tab} from 'ionic2/components';
|
||||||
|
|
||||||
|
|
||||||
|
@Component({ selector: '[ion-app]' })
|
||||||
|
@Template({
|
||||||
|
url: 'main.html',
|
||||||
|
directives: [View, Tabs, Tab]
|
||||||
|
})
|
||||||
|
class IonicApp {
|
||||||
|
constructor() {
|
||||||
|
console.log('IonicApp Start')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bootstrap(IonicApp)
|
@ -11,4 +11,36 @@
|
|||||||
<button class="button">s1</button>
|
<button class="button">s1</button>
|
||||||
</ion-nav-items>
|
</ion-nav-items>
|
||||||
|
|
||||||
|
<ion-content class="padding">
|
||||||
|
<p>
|
||||||
|
A long time ago, in a galaxy far,
|
||||||
|
far away....
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
It is a period of civil war.
|
||||||
|
Rebel spaceships, striking
|
||||||
|
from a hidden base, have won
|
||||||
|
their first victory against
|
||||||
|
the evil Galactic Empire.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
During the battle, rebel
|
||||||
|
spies managed to steal secret
|
||||||
|
plans to the Empire's
|
||||||
|
ultimate weapon, the DEATH
|
||||||
|
STAR, an armored space
|
||||||
|
station with enough power to
|
||||||
|
destroy an entire planet.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Pursued by the Empire's
|
||||||
|
sinister agents, Princess
|
||||||
|
Leia races home aboard her
|
||||||
|
starship, custodian of the
|
||||||
|
stolen plans that can save
|
||||||
|
her people and restore
|
||||||
|
freedom to the galaxy....
|
||||||
|
</p>
|
||||||
|
</ion-content>
|
||||||
|
|
||||||
</ion-view>
|
</ion-view>
|
||||||
|
@ -29,7 +29,8 @@ export let ToolbarConfig = new ComponentConfig('toolbar')
|
|||||||
<div class="toolbar-item toolbar-secondary-item">
|
<div class="toolbar-item toolbar-secondary-item">
|
||||||
<content select="ion-nav-items[side=secondary]"></content>
|
<content select="ion-nav-items[side=secondary]"></content>
|
||||||
</div>
|
</div>
|
||||||
</div>`,
|
</div>
|
||||||
|
<div class="shared-toolbar"></div>`,
|
||||||
directives: [BackButton]
|
directives: [BackButton]
|
||||||
})
|
})
|
||||||
export class Toolbar {
|
export class Toolbar {
|
||||||
|
@ -71,3 +71,12 @@ $toolbar-background: #f7f7f8 !default;
|
|||||||
.toolbar-secondary-item {
|
.toolbar-secondary-item {
|
||||||
@include flex-order(4);
|
@include flex-order(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.shared-toolbar {
|
||||||
|
display: none;
|
||||||
|
width: 100%;
|
||||||
|
height: 44px;
|
||||||
|
background: red;
|
||||||
|
}
|
||||||
|
@ -13,7 +13,7 @@ export let ViewConfig = new ComponentConfig('view')
|
|||||||
})
|
})
|
||||||
@Template({
|
@Template({
|
||||||
inline: `
|
inline: `
|
||||||
<ion-toolbar [nav-title]="title">
|
<ion-toolbar class="view-toolbar" [nav-title]="title">
|
||||||
<content select="ion-nav-title"></content>
|
<content select="ion-nav-title"></content>
|
||||||
<content select="ion-nav-items[side=primary]"></content>
|
<content select="ion-nav-items[side=primary]"></content>
|
||||||
<content select="ion-nav-items[side=secondary]"></content>
|
<content select="ion-nav-items[side=secondary]"></content>
|
||||||
|
0
src/webview/node-webkit/node-webkit.scss
Normal file
0
src/webview/node-webkit/node-webkit.scss
Normal file
Reference in New Issue
Block a user