2018-04-10 01:09:18 +08:00
|
|
|
---
|
2019-04-01 10:15:15 +08:00
|
|
|
order: 100
|
2018-04-10 01:09:18 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 自定义标题
|
|
|
|
en-US: Title
|
2019-04-01 10:15:15 +08:00
|
|
|
debug: true
|
2018-04-10 01:09:18 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
2019-04-01 10:15:15 +08:00
|
|
|
设置鼠标放在状态点上时显示的文字。
|
2018-04-10 01:09:18 +08:00
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
The badge will display `title` when hovered over, instead of `count`.
|
|
|
|
|
2019-05-07 14:57:32 +08:00
|
|
|
```jsx
|
2018-04-10 01:09:18 +08:00
|
|
|
import { Badge } from 'antd';
|
|
|
|
|
|
|
|
ReactDOM.render(
|
|
|
|
<div>
|
|
|
|
<Badge count={5} title="Custom hover text">
|
|
|
|
<a href="#" className="head-example" />
|
|
|
|
</Badge>
|
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-04-10 01:09:18 +08:00
|
|
|
|
|
|
|
<style>
|
2018-08-20 15:07:05 +08:00
|
|
|
.ant-badge:not(.ant-badge-not-a-wrapper) {
|
2018-04-10 01:09:18 +08:00
|
|
|
margin-right: 20px;
|
|
|
|
}
|
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;
|
|
|
|
}
|
|
|
|
|
2018-04-10 01:09:18 +08:00
|
|
|
.head-example {
|
|
|
|
width: 42px;
|
|
|
|
height: 42px;
|
2019-12-25 11:02:45 +08:00
|
|
|
border-radius: 2px;
|
2018-04-10 01:09:18 +08:00
|
|
|
background: #eee;
|
|
|
|
display: inline-block;
|
|
|
|
}
|
2019-12-25 11:02:45 +08:00
|
|
|
[data-theme="dark"] .head-example {
|
|
|
|
background: rgba(255,255,255,.12);
|
|
|
|
}
|
2018-04-10 01:09:18 +08:00
|
|
|
</style>
|