跳到主要内容
版本:v8

支持 CSS 自定义属性的标签栏组件

shadow

标签栏是一个包含一组标签按钮的 UI 组件。必须将其放置在标签组件内部,以便与各个标签页进行通信。

使用方法

<ion-tabs>
<!-- 标签栏 -->
<ion-tab-bar slot="bottom">
<ion-tab-button tab="account">
<ion-icon name="person"></ion-icon>
</ion-tab-button>
<ion-tab-button tab="contact">
<ion-icon name="call"></ion-icon>
</ion-tab-button>
<ion-tab-button tab="settings">
<ion-icon name="settings"></ion-icon>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>

标签按钮中的徽章

可以在标签按钮内添加徽章,通常用于指示通知或高亮显示与该元素相关的附加项目。

信息

空徽章仅适用于 md 模式。

属性

color

DescriptionThe color to use from your application's color palette. Default options are: "primary", "secondary", "tertiary", "success", "warning", "danger", "light", "medium", and "dark". For more information on colors, see theming.
Attributecolor
Type"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string | undefined
Defaultundefined

mode

DescriptionThe mode determines which platform styles to use.

This is a virtual property that is set once during initialization and will not update if you change its value after the initial render.
Attributemode
Type"ios" | "md"
Defaultundefined

selectedTab

DescriptionThe selected tab component
Attributeselected-tab
Typestring | undefined
Defaultundefined

translucent

DescriptionIf true, the tab bar will be translucent. Only applies when the mode is "ios" and the device supports backdrop-filter.
Attributetranslucent
Typeboolean
Defaultfalse

事件

No events available for this component.

方法

No public methods available for this component.

CSS Shadow Parts

No CSS shadow parts available for this component.

CSS 自定义属性

NameDescription
--backgroundBackground of the tab bar
--borderBorder of the tab bar
--colorColor of the tab bar

插槽

No slots available for this component.