Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add title prop to Badge that shows when hovering it
- Loading branch information
Showing
6 changed files
with
224 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
order: 7 | ||
title: | ||
zh-CN: 自定义标题 | ||
en-US: Title | ||
--- | ||
|
||
## zh-CN | ||
|
||
设置鼠标放在状态点上时显示的文字 | ||
|
||
## en-US | ||
|
||
The badge will display `title` when hovered over, instead of `count`. | ||
|
||
````jsx | ||
import { Badge } from 'antd'; | ||
|
||
ReactDOM.render( | ||
<div> | ||
<Badge count={5} title="Custom hover text"> | ||
<a href="#" className="head-example" /> | ||
</Badge> | ||
</div> | ||
, mountNode); | ||
```` | ||
|
||
<style> | ||
.ant-badge:not(.ant-badge-status) { | ||
margin-right: 20px; | ||
} | ||
.head-example { | ||
width: 42px; | ||
height: 42px; | ||
border-radius: 4px; | ||
background: #eee; | ||
display: inline-block; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters