徽标数 Badge
default slot 为空时,将会独立展示徽标。
基本用法。只需指定 count或者 content slot,即可显示徽标。
我们提供多种预设色彩的徽标样式。如果预设值不能满足你的需求,color 字段也可以设置自定义色值。
设置 dot,即可只显示小红点而不显示数字。count > 0 时才显示。
设置 max-count,可以限制最大显示的徽标数值,超过将会加 + 后缀。max-count 默认为 99。
设置 status,可以得到不同的状态点。normal - 正常 processing - 进行中 success - 成功 warning - 提醒 danger - 危险。
设置 text,可设置自定义提示内容。
<badge> Props
Section titled “<badge> Props”| 参数名 | 描述 | 类型 | 默认值 |
|---|---|---|---|
| text | 自定义提示内容 | string | - |
| dot | 显示为小红点 | boolean | false |
| dot-style | 徽标的样式 | object | - |
| max-count | 徽标最大显示数值,如果count超过这个数值会显示为maxCount | number | 99 |
| offset | 设置徽标位置的偏移 | number[] | [] |
| color | 内置的一些颜色 | ColorType | string | - |
| status | 徽标的状态类型 | 'normal' | 'processing' | 'success' | 'warning' | 'danger' | - |
| count | 徽标显示的数字 | number | - |