跳到主要内容
版本:v8

ion-tab

shadow

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

备注

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

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

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

属性​

component​

说明The component to display inside of the tab.
属性component
类型Function | HTMLElement | null | string | undefined
默认值undefined

tab​

说明A 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.
属性tab
类型string
默认值undefined

事件​

该组件没有可用的事件。

方法​

setActive​

说明Set the active component for the tab
签名setActive() => Promise<void>

CSS Shadow Parts​

该组件没有可用的 CSS 阴影部分。

CSS 自定义属性​

该组件没有可用的 CSS 自定义属性。

插槽​

该组件没有可用的插槽。