ion-badge
徽章(Badge)是通常出现在另一个元素附近的内联块元素。通常它们包含一个数字或其他字符。它们可以用作通知,表明与某个元素相关的额外项目并指示有多少个项目。如果没有传入内容,徽章将被隐藏。
基本用法
主题
颜色
CSS 属性
属性
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 |
事件
该组件没有可用的事件。
方法
该组件没有可用的公共方法。
CSS 阴影部分
该组件没有可用的 CSS 阴影部分。
CSS 自定义属性
| Name | 说明 |
|---|---|
--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 |
插槽
该组件没有可用的插槽。