2016-03-31 14:17:09 +08:00
|
|
|
---
|
|
|
|
category: Components
|
|
|
|
chinese: 徽标数
|
2016-05-11 14:21:01 +08:00
|
|
|
type: Presentation
|
2016-03-31 14:17:09 +08:00
|
|
|
english: Badge
|
|
|
|
---
|
2015-09-01 13:59:07 +08:00
|
|
|
|
2015-09-01 17:16:51 +08:00
|
|
|
图标右上角的圆形徽标数字。
|
2015-09-01 13:59:07 +08:00
|
|
|
|
|
|
|
## 何时使用
|
|
|
|
|
2015-09-01 17:16:51 +08:00
|
|
|
一般出现在通知图标或头像的右上角,用于显示需要处理的消息条数,通过醒目视觉形式吸引用户处理。
|
2015-09-01 13:59:07 +08:00
|
|
|
|
|
|
|
## API
|
|
|
|
|
2015-09-01 17:48:22 +08:00
|
|
|
```jsx
|
2015-11-04 18:02:59 +08:00
|
|
|
<Badge count={5}>
|
2015-09-01 17:48:22 +08:00
|
|
|
<a href="#" className="head-example"></a>
|
|
|
|
</Badge>
|
|
|
|
```
|
|
|
|
|
2015-12-18 17:27:22 +08:00
|
|
|
|
|
|
|
```jsx
|
|
|
|
<Badge count={5} />
|
|
|
|
```
|
|
|
|
|
2015-09-01 13:59:07 +08:00
|
|
|
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
|
|
|----------------|----------------------------------|------------|---------|--------|
|
2015-12-11 17:57:09 +08:00
|
|
|
| count | 展示的数字,大于 overflowCount 时显示为 `${overflowCount}+`,为 0 时隐藏 | Number | | |
|
|
|
|
| overflowCount | 展示封顶的数字值 | Number | | 99 |
|
2015-09-01 13:59:07 +08:00
|
|
|
| dot | 不展示数字,只有一个小红点 | boolean | | false |
|