mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-03 00:09:39 +08:00
29 lines
556 B
Markdown
29 lines
556 B
Markdown
---
|
|
order: 4
|
|
debug: true
|
|
title:
|
|
zh-CN: 隐藏后销毁
|
|
en-US: Destroy tooltip when hidden
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
通过 `destroyTooltipOnHide` 控制提示关闭时是否销毁 dom 节点。
|
|
|
|
## en-US
|
|
|
|
Setting `destroyTooltipOnHide` to control whether destroy dom node of tooltip when hidden.
|
|
|
|
```tsx
|
|
import { Tooltip } from 'antd';
|
|
import React from 'react';
|
|
|
|
const App: React.FC = () => (
|
|
<Tooltip destroyTooltipOnHide={{ keepParent: false }} title="prompt text">
|
|
<span>Tooltip will destroy when hidden.</span>
|
|
</Tooltip>
|
|
);
|
|
|
|
export default App;
|
|
```
|