2016-03-31 09:40:55 +08:00
|
|
|
---
|
2016-12-20 11:06:40 +08:00
|
|
|
order: 1
|
2016-07-11 11:45:42 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 独立使用
|
|
|
|
en-US: Standalone
|
2016-03-31 09:40:55 +08:00
|
|
|
---
|
2015-12-18 17:27:22 +08:00
|
|
|
|
2016-07-11 11:45:42 +08:00
|
|
|
## zh-CN
|
|
|
|
|
2015-12-18 17:27:22 +08:00
|
|
|
不包裹任何元素即是独立使用,可自定样式展现。
|
|
|
|
|
|
|
|
> 在右上角的 badge 则限定为红色。
|
|
|
|
|
2016-07-11 11:45:42 +08:00
|
|
|
## en-US
|
|
|
|
|
|
|
|
Used in standalone when children is empty.
|
|
|
|
|
2019-05-07 14:57:32 +08:00
|
|
|
```jsx
|
2015-12-18 17:27:22 +08:00
|
|
|
import { Badge } from 'antd';
|
|
|
|
|
2017-02-19 20:27:06 +08:00
|
|
|
ReactDOM.render(
|
|
|
|
<div>
|
|
|
|
<Badge count={25} />
|
2019-12-25 11:02:45 +08:00
|
|
|
<Badge count={4} className="site-badge-count-4" />
|
|
|
|
<Badge className="site-badge-count-109" count={109} style={{ backgroundColor: '#52c41a' }} />
|
2018-06-27 15:55:04 +08:00
|
|
|
</div>,
|
2019-05-07 14:57:32 +08:00
|
|
|
mountNode,
|
2018-11-28 15:00:03 +08:00
|
|
|
);
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|
2018-08-20 15:07:05 +08:00
|
|
|
|
2019-12-25 11:02:45 +08:00
|
|
|
```css
|
|
|
|
.site-badge-count-4 .ant-badge-count {
|
|
|
|
background-color: #fff;
|
|
|
|
color: #999;
|
|
|
|
box-shadow: 0 0 0 1px #d9d9d9 inset;
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2018-08-20 15:07:05 +08:00
|
|
|
<style>
|
|
|
|
.ant-badge-not-a-wrapper:not(.ant-badge-status) {
|
|
|
|
margin-right: 8px;
|
|
|
|
}
|
2020-01-02 19:10:16 +08:00
|
|
|
.ant-badge.ant-badge-rtl:not(.ant-badge-not-a-wrapper) {
|
|
|
|
margin-right: 0;
|
|
|
|
margin-left: 20px;
|
|
|
|
}
|
2019-12-25 11:02:45 +08:00
|
|
|
[data-theme="dark"] .site-badge-count-4 .ant-badge-count {
|
|
|
|
background-color: #141414;
|
|
|
|
box-shadow: 0 0 0 1px #434343 inset;
|
|
|
|
}
|
2018-08-20 15:07:05 +08:00
|
|
|
</style>
|