ion-badge
徽章通常是内联块元素,出现在其他元素附近。它们通常包含数字或其他字符。徽章可用作通知,表示某个元素关联了额外项目,并指示具体数量。如果未传入内容,徽章会隐藏。
基本用法
主题定制
颜色
CSS 属性
属性
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 | "danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string | undefined |
| Default | undefined |
mode
| Description | The 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. |
| Attribute | mode |
| Type | "ios" | "md" |
| Default | undefined |
事件
No events available for this component.
方法
No public methods available for this component.
CSS 阴影部件
No CSS shadow parts available for this component.
CSS 自定义属性
| Name | Description |
|---|---|
--background | Background of the badge |
--color | Text color of the badge |
--padding-bottom | Bottom padding of the badge |
--padding-end | Right padding if direction is left-to-right, and left padding if direction is right-to-left of the badge |
--padding-start | Left padding if direction is left-to-right, and right padding if direction is right-to-left of the badge |
--padding-top | Top padding of the badge |