mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
docs: update docs for Tooltip Popconfirm Popover
This commit is contained in:
parent
2d19ea8344
commit
8b3e488485
@ -16,12 +16,10 @@ The difference with `confirm` is more lightweight than the static popped full-sc
|
||||
|
||||
| Param | Description | Type | Default value |
|
||||
|-----------|------------------------------------------|---------------|--------|
|
||||
| placement | position of the confirmation box, optional `top/left/right/bottom` `topLeft/topRight/bottomLeft/bottomRight` `leftTop/leftBottom/rightTop/rightBottom` | string | top |
|
||||
| title | title of the confirmation box | React.Element | none |
|
||||
| onConfirm | callback of confirmation | function | none |
|
||||
| onCancel | callback of cancel | function | none |
|
||||
| onVisibleChange | callback of the visible attribute changed | function(visible) | none |
|
||||
| okText | text of the confirmation button | String | Confirm |
|
||||
| cancelText| text of the cancel button | String | Cancel |
|
||||
| openClassName | class name of the trigger, using for highlighting the trigger while triggered | string | ant-popover-open |
|
||||
| arrowPointAtCenter | whether arrow pointed at the center of target, supported after `antd@1.11+` | Boolean | `false` |
|
||||
|
||||
Consult [Tooltip's documentation](https://ant.design/components/tooltip/#API) to find more APIs.
|
||||
|
@ -13,17 +13,14 @@ title: Popconfirm
|
||||
|
||||
和 `confirm` 弹出的全屏居中模态对话框相比,交互形式更轻量。
|
||||
|
||||
|
||||
## API
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|------------------------------------------|---------------|--------|
|
||||
| placement | 气泡框位置,可选 `top/left/right/bottom` `topLeft/topRight/bottomLeft/bottomRight` `leftTop/leftBottom/rightTop/rightBottom` | string | top |
|
||||
| title | 确认框的描述 | React.Element | 无 |
|
||||
| onConfirm | 点击确认的回调 | function | 无 |
|
||||
| onCancel | 点击取消的回调 | function | 无 |
|
||||
| onVisibleChange | 显示隐藏的回调 | function(visible) | 无 |
|
||||
| okText | 确认按钮文字 | String | 确定 |
|
||||
| cancelText| 取消按钮文字 | String | 取消 |
|
||||
| openClassName | 气泡框展现时触发器添加的类名,可用于打开浮层时高亮触发器 | string | ant-popover-open |
|
||||
| arrowPointAtCenter | 箭头是否指向目标元素中心,`antd@1.11+` 支持 | Boolean | `false` |
|
||||
|
||||
更多属性请参考 [Tooltip](https://ant.design/components/tooltip/#API)。
|
||||
|
@ -16,14 +16,7 @@ Comparing with `Tooltip`, besides information `Popover` card can also provide ac
|
||||
|
||||
| Param | Description | Type | Default value |
|
||||
|-----------|------------------------------------------|---------------|--------|
|
||||
| trigger | triggering mode: can be hover, focus, or click. | string | hover |
|
||||
| placement | position of the card,optional `top/left/right/bottom` `topLeft/topRight/bottomLeft/bottomRight` `leftTop/leftBottom/rightTop/rightBottom` | string | top |
|
||||
| title | title of the card | React.Element | none |
|
||||
| content | content of the card | React.Element | none |
|
||||
| overlayClassName | class name of the card | string | none |
|
||||
| overlayStyle | style of the card | object | none |
|
||||
| visible | make the float card visible or not | boolean | false |
|
||||
| onVisibleChange | callback of the visible attribute changed | function | none |
|
||||
| getTooltipContainer | rendered to the root of the menu. Default rendered to the body dom. If gets any problem of the menu while scrolling. Try to make the root the dom scrolled, and make it position relative. [Sample](http://codepen.io/anon/pen/xVBOVQ?editors=001) | Function(triggerNode) | () => document.body |
|
||||
| openClassName | class name of the trigger, using for highlighting the trigger while triggered | string | ant-popover-open |
|
||||
| arrowPointAtCenter | whether arrow pointed at the center of target, supported after `antd@1.11+` | Boolean | `false` |
|
||||
|
||||
Consult [Tooltip's documentation](https://ant.design/components/tooltip/#API) to find more APIs.
|
||||
|
@ -6,7 +6,7 @@ import warning from '../_util/warning';
|
||||
|
||||
export interface PopoverProps extends AbstractTooltipProps {
|
||||
title?: React.ReactNode;
|
||||
content?: React.ReactNode | string;
|
||||
content?: React.ReactNode;
|
||||
}
|
||||
|
||||
export default class Popover extends React.Component<PopoverProps, any> {
|
||||
|
@ -17,14 +17,7 @@ title: Popover
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|------------------------------------------|---------------|--------|
|
||||
| trigger | 触发行为,可选 `hover/focus/click` | string | hover |
|
||||
| placement | 气泡框位置,可选 `top/left/right/bottom` `topLeft/topRight/bottomLeft/bottomRight` `leftTop/leftBottom/rightTop/rightBottom` | string | top |
|
||||
| title | 卡片标题 | React.Element | 无 |
|
||||
| content | 卡片内容 | React.Element | 无 |
|
||||
| overlayClassName | 卡片类名 | string | 无 |
|
||||
| overlayStyle | 卡片样式 | object | 无 |
|
||||
| visible | 用于手动控制浮层显隐 | boolean | false |
|
||||
| onVisibleChange | 显示隐藏改变的回调 | function | 无 |
|
||||
| getTooltipContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](http://codepen.io/anon/pen/xVBOVQ?editors=001) | Function(triggerNode) | () => document.body |
|
||||
| openClassName | 气泡框展现时触发器添加的类名,可用于打开浮层时高亮触发器 | string | ant-popover-open |
|
||||
| arrowPointAtCenter | 箭头是否指向目标元素中心,`antd@1.11+` 支持 | Boolean | `false` |
|
||||
|
||||
更多属性请参考 [Tooltip](https://ant.design/components/tooltip/#API)。
|
||||
|
@ -15,9 +15,19 @@ A simple text popup tip.
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|-----------|------------------------------------------|------------|--------|
|
||||
| placement | to set the position, which can be one of `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | top |
|
||||
| title | prompt text | string/React.Element | - |
|
||||
|
||||
### Common API
|
||||
|
||||
The following APIs are shared by Tooltip, Popconfirm, Popover.
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|-----------|------------------------------------------|------------|--------|
|
||||
| placement | to set the position, which can be one of `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | top |
|
||||
| getTooltipContainer | to set the container of the tip, while the default is to create a `div` element in `body` | Function(triggerNode) | () => document.body |
|
||||
| arrowPointAtCenter | whether arrow pointed at the center of target, supported after `antd@1.11+` | Boolean | `false` |
|
||||
|
||||
You can visit https://github.com/react-component/tooltip for more API.
|
||||
| visible | make the float card visible or not | boolean | false |
|
||||
| onVisibleChange | callback of the visible attribute changed | function(visible) | none |
|
||||
| trigger | triggering mode: can be hover, focus, or click. | string | hover |
|
||||
| overlayClassName | class name of the card | string | none |
|
||||
| overlayStyle | style of the card | object | none |
|
||||
|
@ -15,11 +15,21 @@ title: Tooltip
|
||||
|
||||
## API
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|------------------------------------------|------------|--------|
|
||||
| title | 提示文字 | React.ReactNode | 无 |
|
||||
|
||||
### 共同的 API
|
||||
|
||||
以下 API 为 Tooltip、Popconfirm、Popover 共享的 API。
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|------------------------------------------|------------|--------|
|
||||
| placement | 气泡框位置,可选 `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | top |
|
||||
| title | 提示文字 | string/React.Element | 无 |
|
||||
| getTooltipContainer | 浮层渲染父节点。默认渲染到 body 上 | Function(triggerNode) | () => document.body |
|
||||
| arrowPointAtCenter | 箭头是否指向目标元素中心,`antd@1.11+` 支持 | Boolean | `false` |
|
||||
|
||||
更多 API 可参考:https://github.com/react-component/tooltip
|
||||
| visible | 用于手动控制浮层显隐 | boolean | false |
|
||||
| onVisibleChange | 显示隐藏的回调 | function(visible) | 无 |
|
||||
| trigger | 触发行为,可选 `hover/focus/click` | string | hover |
|
||||
| overlayClassName | 卡片类名 | string | 无 |
|
||||
| overlayStyle | 卡片样式 | object | 无 |
|
||||
|
Loading…
Reference in New Issue
Block a user