Skip to content

徽标 Badge ​

用于展示消息数量、状态红点等。

Props

属性类型默认值说明
countnumber | string0显示的数字/内容
maxnumber99最大值,超过显示 max+
dotbooleanfalse小圆点模式(不显示数字)
showZerobooleantruecount 为 0 时是否显示
colorstring''自定义背景色

示例

vue
<template>
  <Badge :count="5">
    <span>消息</span>
  </Badge>
  <Badge :count="100" :max="99">
    <span>评论</span>
  </Badge>
  <Badge dot>
    <span>在线</span>
  </Badge>
</template>

Released under the MIT License.