跳到主要内容
版本:v8

选项卡组件

shadow

标签页组件是 tabs 的子组件。每个标签页可以包含一个应用的顶级导航栈或单个视图。一个应用可以拥有多个标签页,每个都具备独立的导航功能。

备注

对于 Angular、React 和 Vue,只有在 ion-tabs 组件配置为 基础用法 时才能使用此组件。当通过路由配置标签页时,无法使用 ion-tab 组件。

在 JavaScript 中,此组件可以与配置为 基础用法配合路由器使用ion-tabs 组件一同使用。

更多关于配置标签页的细节,请参阅 tabs 文档

属性

component

DescriptionThe component to display inside of the tab.
Attributecomponent
TypeFunction | HTMLElement | null | string | undefined
Defaultundefined

tab

DescriptionA tab id must be provided for each ion-tab. It's used internally to reference the selected tab or by the router to switch between them.
Attributetab
Typestring
Defaultundefined

事件

No events available for this component.

方法

setActive

DescriptionSet the active component for the tab
SignaturesetActive() => Promise<void>

CSS 影子部件

No CSS shadow parts available for this component.

CSS 自定义属性

No CSS custom properties available for this component.

插槽

No slots available for this component.