2016-03-31 09:40:55 +08:00
|
|
|
---
|
|
|
|
order: 5
|
2016-07-21 09:51:04 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 自定义提示
|
|
|
|
en-US: Customerize tooltip
|
2016-03-31 09:40:55 +08:00
|
|
|
---
|
2015-11-25 11:34:55 +08:00
|
|
|
|
2016-07-21 09:51:04 +08:00
|
|
|
## zh-CN
|
|
|
|
|
2015-12-24 09:54:59 +08:00
|
|
|
使用 `tipFormatter` 可以格式化 `Tooltip` 的内容,设置 `tipFormatter={null}`,则隐藏 `Tooltip`。
|
2015-11-25 11:34:55 +08:00
|
|
|
|
2016-07-21 09:51:04 +08:00
|
|
|
## en-US
|
|
|
|
|
|
|
|
Use `tipFormatter` to formart content of `Toolip`. If `tipFormatter` is null, hide it.
|
|
|
|
|
2015-11-25 11:34:55 +08:00
|
|
|
````jsx
|
|
|
|
import { Slider } from 'antd';
|
|
|
|
|
|
|
|
function formatter(value) {
|
2016-02-17 18:04:42 +08:00
|
|
|
return `${value}%`;
|
2015-11-25 11:34:55 +08:00
|
|
|
}
|
|
|
|
|
2015-12-24 09:54:59 +08:00
|
|
|
ReactDOM.render(<div>
|
|
|
|
<Slider tipFormatter={formatter} />
|
|
|
|
<Slider tipFormatter={null} />
|
2015-12-29 12:08:58 +08:00
|
|
|
</div>, mountNode);
|
2015-11-25 11:34:55 +08:00
|
|
|
````
|