mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 12:09:14 +08:00
parent
b467cc5cbb
commit
b57d306107
@ -51,6 +51,12 @@ exports[`renders ./components/tooltip/demo/basic.md correctly 1`] = `
|
||||
</span>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/tooltip/demo/destroy-tooltip-on-hide.md correctly 1`] = `
|
||||
<span>
|
||||
Tooltip will destroy when hidden.
|
||||
</span>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/tooltip/demo/placement.md correctly 1`] = `
|
||||
<div
|
||||
class="demo"
|
||||
|
25
components/tooltip/demo/destroy-tooltip-on-hide.md
Normal file
25
components/tooltip/demo/destroy-tooltip-on-hide.md
Normal file
@ -0,0 +1,25 @@
|
||||
---
|
||||
order: 4
|
||||
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.
|
||||
|
||||
```jsx
|
||||
import { Tooltip } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<Tooltip destroyTooltipOnHide={{ keepParent: false }} title="prompt text">
|
||||
<span>Tooltip will destroy when hidden.</span>
|
||||
</Tooltip>,
|
||||
mountNode,
|
||||
);
|
||||
```
|
@ -36,6 +36,7 @@ The following APIs are shared by Tooltip, Popconfirm, Popover.
|
||||
| visible | Whether the floating tooltip card is visible or not | boolean | `false` | |
|
||||
| onVisibleChange | Callback executed when visibility of the tooltip card is changed | (visible) => void | - | |
|
||||
| align | this value will be merged into placement's config, please refer to the settings [rc-tooltip](https://github.com/react-component/tooltip) | Object | - | |
|
||||
| destroyTooltipOnHide | whether destroy tooltip when hidden, parent container of tooltip will be destroyed when `keepParent` is `false` | boolean \| { keepParent?: boolean } | false | |
|
||||
|
||||
## Note
|
||||
|
||||
|
@ -38,6 +38,7 @@ title: Tooltip
|
||||
| visible | 用于手动控制浮层显隐 | boolean | false | |
|
||||
| onVisibleChange | 显示隐藏的回调 | (visible) => void | 无 | |
|
||||
| align | 该值将合并到 placement 的配置中,设置参考 [rc-tooltip](https://github.com/react-component/tooltip) | Object | 无 | |
|
||||
| destroyTooltipOnHide | 关闭后是否销毁 Tooltip,当 `keepParent` 为 `false` 时销毁父容器 | boolean \| { keepParent?: boolean } | false | |
|
||||
|
||||
## 注意
|
||||
|
||||
|
@ -137,7 +137,7 @@
|
||||
"rc-switch": "~3.1.0",
|
||||
"rc-table": "~7.7.0",
|
||||
"rc-tabs": "~10.1.1",
|
||||
"rc-tooltip": "~4.0.2",
|
||||
"rc-tooltip": "~4.1.0",
|
||||
"rc-tree": "~3.2.0",
|
||||
"rc-tree-select": "~3.1.0",
|
||||
"rc-trigger": "~4.1.0",
|
||||
|
Loading…
Reference in New Issue
Block a user