mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-05 23:46:28 +08:00
parent
1e1baf01f6
commit
499b81f79d
@ -32,6 +32,7 @@ The following APIs are shared by Tooltip, Popconfirm, Popover.
|
||||
| overlayStyle | Style of the tooltip card | object | - |
|
||||
| placement | The position of the tooltip relative to the target, which can be one of `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | `top` |
|
||||
| trigger | Tooltip trigger mode | `hover` \| `focus` \| `click` | `hover` |
|
||||
| defaultVisible | Whether the floating tooltip card is visible by default | boolean | `false` |
|
||||
| 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 | - |
|
||||
|
||||
|
@ -16,6 +16,7 @@ export interface AbstractTooltipProps {
|
||||
overlayStyle?: React.CSSProperties;
|
||||
placement?: TooltipPlacement;
|
||||
builtinPlacements?: Object;
|
||||
defaultVisible?: boolean;
|
||||
visible?: boolean;
|
||||
onVisibleChange?: (visible: boolean) => void;
|
||||
mouseEnterDelay?: number;
|
||||
@ -67,7 +68,7 @@ export default class Tooltip extends React.Component<TooltipProps, any> {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
visible: !!props.visible,
|
||||
visible: !!props.visible || !!props.defaultVisible,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@ title: Tooltip
|
||||
| overlayStyle | 卡片样式 | object | 无 |
|
||||
| placement | 气泡框位置,可选 `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | top |
|
||||
| trigger | 触发行为,可选 `hover/focus/click` | string | hover |
|
||||
| defaultVisible | 默认是否显隐 | boolean | false |
|
||||
| visible | 用于手动控制浮层显隐 | boolean | false |
|
||||
| onVisibleChange | 显示隐藏的回调 | (visible) => void | 无 |
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user