mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-29 21:59:41 +08:00
aa97494625
* feat: change slide tooltip api * fix: deprecated warning * refactor: remove boolean type support for Slider tooltip * feat: update warning text * chore: fix typo * chore: save prod perf * test: back of test case * chore: clean up * chore: fix test require Co-authored-by: 二货机器人 <smith3816@gmail.com>
31 lines
590 B
Markdown
31 lines
590 B
Markdown
---
|
|
order: 3
|
|
title:
|
|
zh-CN: 自定义提示
|
|
en-US: Customize tooltip
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
使用 `tooltip.formatter` 可以格式化 `Tooltip` 的内容,设置 `tooltip.formatter={null}`,则隐藏 `Tooltip`。
|
|
|
|
## en-US
|
|
|
|
Use `tooltip.formatter` to format content of `Tooltip`. If `tooltip.formatter` is null, hide it.
|
|
|
|
```tsx
|
|
import { Slider } from 'antd';
|
|
import React from 'react';
|
|
|
|
const formatter = (value: number) => `${value}%`;
|
|
|
|
const App: React.FC = () => (
|
|
<>
|
|
<Slider tooltip={{ formatter }} />
|
|
<Slider tooltip={{ formatter: null }} />
|
|
</>
|
|
);
|
|
|
|
export default App;
|
|
```
|