Ionic-js-tabs
提供:Dev Guides
Ionic-Javascriptタブ
タブは、ナビゲーションタイプやアプリ内のさまざまなページを選択する場合に便利なパターンです。 Androidデバイスの場合は画面の上部に、IOSデバイスの場合は下部に同じタブが表示されます。
タブを使用する
indexlコード
出力は次のスクリーンショットのようになります。
タブ属性
Attribute | Type | Details |
---|---|---|
title | string | The title of the tab. |
href | string | The link used for tab navigation. |
icon | string | The icon of the tab. |
icon-on | string | The icon of the tab when selected. |
icon-off | string | The icon of the tab when not selected. |
badge | expression | The badge for the tab. |
badge-style | expression | The badge style for the tab. |
on-select | expression | Called when tab is selected |
on-deselect | expression | Called when tab is deselected |
hidden | expression | Used to hide the tab. |
disabled | expression | Used to disable the tab. |
また、タブには独自のデリゲートサービスがあり、アプリ内のすべてのタブを簡単に制御できます。 コントローラーに挿入でき、次の表に示すいくつかのメソッドがあります。
デリゲートメソッド
Method | Parameters | Type | Details |
---|---|---|---|
selectedIndex() | / | number | Returns the index of the selected tab. |
$getByHandle(parameter1) | handle | string | Used to connect methods to the particular tab view with the same handle. Handle can be added to ion-tabs *by using delegate-handle = "my-handle" attribute. $ionicTabsDelegate.$getByHandle('my-handle').selectedIndex();* |