Badge (徽标)

包裹触发元素的计数或圆点角标;max 限制显示的最大计数。

基础用法

512
Basic.vue

圆点

Dot.vue

上限

899+999+
Max.vue

颜色

555555
Colors.vue

独立

未读 3 在线 通知 99+
Standalone.vue

属性

属性类型默认值说明
ariaLabelstringAccessible name (e.g. "5 条未读"). Without an anchor slot the badge renders standalone (inline), not as a corner overlay.
classNamestring""
colorKunUIColor"danger"
countnumber0
maxnumber99
placement"top-right" | "top-left" | "bottom-right" | "bottom-left""top-right"
showbooleantrue
showZerobooleanfalse
size"sm" | "md" | "lg""md"
variant"count" | "dot""count"

插槽

插槽作用域
#default