ion-badge
徽章是内联块元素,通常出现在另一个元素附近。通常它们包含数字或其他字符。它们可以用作通知,表明存在与元素关联的其他项目,并指示有多少个项目。如果没有传入任何内容,徽章将被隐藏。
¥Badges are inline block elements that usually appear near another element. Typically they contain a number or other characters. They can be used as a notification that there are additional items associated with an element and indicate how many items there are. Badges are hidden if no content is passed in.
基本用法
¥Basic Usage
主题化
¥Theming
颜色
¥Colors
CSS 属性
¥CSS Properties
属性
¥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 | "danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string | undefined |
Default | undefined |
mode
Description | The mode determines which platform styles to use. |
Attribute | mode |
Type | "ios" | "md" |
Default | undefined |
事件
¥Events
No events available for this component.
方法
¥Methods
No public methods available for this component.
CSS 阴影部分
¥CSS Shadow Parts
No CSS shadow parts available for this component.
CSS 自定义属性
¥CSS Custom Properties
- iOS
- MD
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 |
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 |
插槽
¥Slots
No slots available for this component.