跳至主要內容
版本:v8

ion-tab-button

陰影

分頁按鈕是一種 UI 元件,放置在分頁列內。分頁按鈕可以指定圖示和標籤的配置,並連接到分頁視圖

請參閱分頁文件,以了解有關配置分頁的更多詳細資訊。

用法

<ion-tabs>
<!-- Tab bar -->
<ion-tab-bar slot="bottom">
<ion-tab-button tab="schedule">
<ion-icon name="calendar" aria-hidden="true"></ion-icon>
<ion-label>Schedule</ion-label>
</ion-tab-button>

<ion-tab-button tab="speakers">
<ion-icon name="person-circle" aria-hidden="true"></ion-icon>
<ion-label>Speakers</ion-label>
</ion-tab-button>

<ion-tab-button tab="map">
<ion-icon name="map" aria-hidden="true"></ion-icon>
<ion-label>Map</ion-label>
</ion-tab-button>

<ion-tab-button tab="about">
<ion-icon name="information-circle" aria-hidden="true"></ion-icon>
<ion-label>About</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>

屬性

disabled

描述如果為 true,則使用者無法與分頁按鈕互動。
屬性disabled
類型boolean
預設false

download

描述此屬性指示瀏覽器下載 URL 而不是導覽至該 URL,因此系統會提示使用者將其儲存為本機檔案。如果屬性具有值,則會在「儲存」提示中使用該值作為預先填入的檔案名稱(使用者仍然可以變更檔案名稱)。
屬性download
類型string | undefined
預設undefined

href

描述包含超連結指向的 URL 或 URL 片段。如果設定此屬性,將會呈現錨點標籤。
屬性href
類型string | undefined
預設undefined

layout

描述設定分頁列中文字和圖示的配置。預設為 "icon-top"
屬性layout
類型"icon-bottom" | "icon-end" | "icon-hide" | "icon-start" | "icon-top" | "label-hide" | undefined
預設undefined

mode

描述模式決定要使用哪個平台樣式。
屬性mode
類型"ios" | "md"
預設undefined

rel

描述指定目標物件與連結物件的關係。該值是以空格分隔的連結類型清單。
屬性rel
類型string | undefined
預設undefined

selected

描述選取的分頁元件
屬性selected
類型boolean
預設false

tab

描述必須為每個 ion-tab 提供分頁 ID。它在內部用於參考選取的分頁,或由路由器用於在它們之間切換。
屬性tab
類型string | undefined
預設undefined

target

描述指定要在哪裡顯示連結的 URL。僅當提供 href 時才適用。特殊關鍵字:"_blank""_self""_parent""_top"
屬性target
類型string | undefined
預設undefined

事件

此元件沒有可用的事件。

方法

此元件沒有可用的公開方法。

CSS 陰影部分

名稱描述
native包裝所有子元素的原生 HTML 錨點元素。

CSS 自訂屬性

名稱描述
--background分頁按鈕的背景
--background-focused使用 Tab 鍵聚焦時分頁按鈕的背景
--background-focused-opacity使用 Tab 鍵聚焦時分頁按鈕背景的不透明度
--color分頁按鈕的顏色
--color-focused使用 Tab 鍵聚焦時分頁按鈕的顏色
--color-selected選取的分頁按鈕的顏色
--padding-bottom分頁按鈕的底部內距
--padding-end如果方向為由左至右,則為分頁按鈕的右內距;如果方向為由右至左,則為左內距
--padding-start如果方向為由左至右,則為分頁按鈕的左內距;如果方向為由右至左,則為右內距
--padding-top分頁按鈕的頂部內距
--ripple-color按鈕漣漪效果的顏色

插槽

此元件沒有可用的插槽。