Skip to main content

ion-tab

shadow

选项卡组件是 tabs 的子组件。每个选项卡可以包含一个应用的顶层导航堆栈或单个视图。一个应用可以有多个选项卡,每个选项卡都有自己独立的导航。

🌐 The tab component is a child component of tabs. Each tab can contain a top level navigation stack for an app or a single view. An app can have many tabs, all with their own independent navigation.

note

只有在为 ion-tabs 组件配置了基本用法时,Angular、React 和 Vue 才能使用此组件。在使用路由设置选项卡时,不能使用 ion-tab 组件。

在 JavaScript 中,此组件可以与 ion-tabs 组件一起使用,后者可配置为基本用法路由用法

🌐 In JavaScript, this component can be used with the ion-tabs component configured for either basic usage or usage with router. :::

有关配置选项卡的更多详细信息,请参见选项卡文档

🌐 See the tabs documentation for more details on configuring tabs.

属性

🌐 Properties

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

事件

🌐 Events

No events available for this component.

方法

🌐 Methods

setActive

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

CSS 阴影部分

🌐 CSS Shadow Parts

No CSS shadow parts available for this component.

CSS 自定义属性

🌐 CSS Custom Properties

No CSS custom properties available for this component.

插槽

🌐 Slots

No slots available for this component.