ant-design/components/slider/demo/tip-formatter.md

31 lines
528 B
Markdown
Raw Normal View History

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