From 87e976bb7e2ddb313827638e88ea8ba4e28b3944 Mon Sep 17 00:00:00 2001 From: Justineo Date: Mon, 18 Oct 2021 16:51:32 +0800 Subject: [PATCH] feat: add tooltip `aim-center` and refine position demo --- one/docs/components/tooltip.md | 7 +- one/docs/demo/popover/position.vue | 331 +++++++++++---------------- one/docs/demo/tooltip/position.vue | 331 +++++++++++---------------- one/docs/en-US/components/tooltip.md | 1 + 4 files changed, 263 insertions(+), 407 deletions(-) diff --git a/one/docs/components/tooltip.md b/one/docs/components/tooltip.md index d4bb566..2581ee5 100644 --- a/one/docs/components/tooltip.md +++ b/one/docs/components/tooltip.md @@ -28,13 +28,14 @@ | -- | -- | -- | -- | | `ui` | `string=` | - | [^ui] | | `open` | `boolean` | `false` | [^open] | -| `target` | `string|Vue|Node` | - | 参考 [`Overlay`](./overlay) 组件的 `target` 属性。 | +| `target` | `string | Vue | Node` | - | 参考 [`Overlay`](./overlay) 组件的 `target` 属性。 | | `position` | `string` | `'top'` | [^position] | +| `aim-center` | `boolean` | `false` | 指定浮层提示箭头是否始终指向目标元素中心。 | | `trigger` | `string` | `'hover'` | [^trigger] | | `interactive` | `boolean` | `true` | 浮层内容是否允许交互。如果为 `false` 则在 `target` 外满足 `trigger` 指定的条件浮层即自动关闭。 | | `hide-delay` | `number` | `tooltip.hideDelays` | 触发关闭条件满足后延迟关闭等待时间的毫秒数。可以用来防止光标移出 `target` 后移入浮层进行交互前已经自动关闭。 | -| `overlay-class` | `string|Array|Object=` | - | 参考 [`Overlay`](./overlay) 组件的 [`overlay-class`](./overlay#属性) 属性。 | -| `overlay-style` | `string|Array|Object=` | - | 参考 [`Overlay`](./overlay) 组件的 [`overlay-style`](./overlay#属性) 属性。 | +| `overlay-class` | `string | Array | Object=` | - | 参考 [`Overlay`](./overlay) 组件的 [`overlay-class`](./overlay#属性) 属性。 | +| `overlay-style` | `string | Array | Object=` | - | 参考 [`Overlay`](./overlay) 组件的 [`overlay-style`](./overlay#属性) 属性。 | ^^^ui 预设样式。 diff --git a/one/docs/demo/popover/position.vue b/one/docs/demo/popover/position.vue index 5db6f0d..a0ae5e9 100644 --- a/one/docs/demo/popover/position.vue +++ b/one/docs/demo/popover/position.vue @@ -1,224 +1,151 @@ + + +使用 `aim-center` 属性来设置浮层提示箭头始终对准目标元素中心,适合用于目标元素较小的场景。 + diff --git a/one/docs/demo/tooltip/position.vue b/one/docs/demo/tooltip/position.vue index 3bfd515..c68feb7 100644 --- a/one/docs/demo/tooltip/position.vue +++ b/one/docs/demo/tooltip/position.vue @@ -1,224 +1,151 @@ + + +使用 `aim-center` 属性来设置浮层提示箭头始终对准目标元素中心,适合用于目标元素较小的场景。 + diff --git a/one/docs/en-US/components/tooltip.md b/one/docs/en-US/components/tooltip.md index 98da04e..d79e5e1 100644 --- a/one/docs/en-US/components/tooltip.md +++ b/one/docs/en-US/components/tooltip.md @@ -30,6 +30,7 @@ Use the `trigger` prop to specify when to show/hide the tooltip. | `open` | `boolean` | `false` | [^open] | | `target` | `string|Vue|Node` | - | See the [`target` prop](./overlay#props) of thh [`Overlay`](./overlay) component. | | `position` | `string` | `'top'` | [^position] | +| `aim-center` | `boolean` | `false` | Whether the tooltip arrow always points to the center of the target element. | | `trigger` | `string` | `'hover'` | [^trigger] | | `interactive` | `boolean` | `true` | Whether the tooltip content is interactive. When set to `false`, the tooltip will be automatically hidden after the event specified by `trigger` is triggered outside the `target`. | | `hide-delay` | `number` | `tooltip.hideDelays` | Time (in milliseconds) to wait before hiding the tooltip after the close trigger is triggered. Can be used to prevent the tooltip being immediately closed after pointer leaves the `target` element and before it enters the tooltip itself. |