跳到主要内容
版本:v7

ion-badge

shadow

徽章通常是内联块元素,出现在其他元素附近。它们通常包含数字或其他字符。徽章可用作通知,表示某个元素关联了额外项目,并指示具体数量。如果未传入内容,徽章会隐藏。

基本用法

主题定制

颜色

CSS 属性

属性

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

事件

No events available for this component.

方法

No public methods available for this component.

CSS 阴影部件

No CSS shadow parts available for this component.

CSS 自定义属性

NameDescription
--backgroundBackground of the badge
--colorText color of the badge
--padding-bottomBottom padding of the badge
--padding-endRight padding if direction is left-to-right, and left padding if direction is right-to-left of the badge
--padding-startLeft padding if direction is left-to-right, and right padding if direction is right-to-left of the badge
--padding-topTop padding of the badge

插槽

No slots available for this component.