ion-tab-bar

概要(CONTENTS)

Ionic4项目中我们可以使用Ionic4底部Tabs组件组件ion-tab-bar对项目进行布局。ion-tab-bar中有ionic ion-tab-bar 用法(Usage) ,ionic ion-tab-bar 属性(Properties) ,ionic ion-tab-bar 中的CSS 自定义属性等

The tab bar is a UI component that contains a set of tab buttons. A tab bar must be provided inside of tabs to communicate with each tab.

ion-tab-bar 用法(Usage)

angular javascript
<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>
<ion-tabs>
  
  <ion-tab tab="account">ion-tab>
  <ion-tab tab="contact">ion-tab>
  <ion-tab tab="settings">ion-tab>

  
  <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>

ion-tab-bar 属性(Properties)

color

Description

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.

Attribute color
Type string | undefined

mode

Description

The mode determines which platform styles to use.

Attribute mode
Type "ios" | "md"

selectedTab

Description

The selected tab component

Attribute selected-tab
Type string | undefined

translucent

Description

If true, the tab bar will be translucent.

Attribute translucent
Type boolean

ion-tab-bar中的CSS 自定义属性

Name Description
--background Background of the tab bar
--border Border of the tab bar
--color Color of the tab bar