跳到主要内容
版本:v8

ion-tab-bar

shadow

选项卡栏是一个 UI 组件,包含一组选项卡按钮。必须在 tabs 内部提供选项卡栏,以便与每个选项卡进行通信。

用法

<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

说明The 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.
属性color
类型"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string | undefined
默认值undefined

mode

说明The mode determines which platform styles to use.

这是一个虚拟属性,在初始化时设置一次,之后更改其值不会更新组件。
属性mode
类型"ios" | "md"
默认值undefined

selectedTab

说明The selected tab component
属性selected-tab
类型string | undefined
默认值undefined

translucent

说明If true, the tab bar will be translucent. Only applies when the mode is "ios" and the device supports backdrop-filter.
属性translucent
类型boolean
默认值false

事件

该组件没有可用的事件。

方法

该组件没有可用的公共方法。

CSS Shadow Parts

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

CSS 自定义属性

Name说明
--backgroundBackground of the tab bar
--borderBorder of the tab bar
--colorColor of the tab bar

插槽

该组件没有可用的插槽。