Skip to content

Tooltip added overlayInnerStyle attribute #6292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: tooltip added overlayInnerStyle attribute
  • Loading branch information
JavanShen committed Feb 19, 2023
commit 4fc6465e0f9d977d7429a2508e0ebba3bac0c337
4 changes: 2 additions & 2 deletions components/tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export default defineComponent({
};

return () => {
const { openClassName, color, overlayClassName } = props;
const { openClassName, color, overlayClassName, overlayInnerStyle } = props;
let children = filterEmpty(slots.default?.()) ?? null;
children = children.length === 1 ? children[0] : children;

Expand Down Expand Up @@ -255,7 +255,7 @@ export default defineComponent({
visible: tempVisible,
ref: tooltip,
overlayClassName: customOverlayClassName,
overlayInnerStyle: formattedOverlayInnerStyle,
overlayInnerStyle: { ...formattedOverlayInnerStyle, ...overlayInnerStyle },
onVisibleChange: handleVisibleChange,
onPopupAlign,
};
Expand Down
4 changes: 4 additions & 0 deletions components/tooltip/abstractTooltipProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export default () => ({
transitionName: String,
overlayStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
overlayClassName: String,
overlayInnerStyle: {
type: Object as PropType<CSSProperties>,
default: undefined as CSSProperties,
},
openClassName: String,
prefixCls: String,
mouseEnterDelay: Number,
Expand Down
1 change: 1 addition & 0 deletions components/tooltip/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ The following APIs are shared by Tooltip, Popconfirm, Popover.
| mouseLeaveDelay | Delay in seconds, before tooltip is hidden on mouse leave | number | 0.1 |
| overlayClassName | Class name of the tooltip card | string | - |
| overlayStyle | Style of the tooltip card | object | - |
| overlayInnerStyle | Style of the tooltip inner content | 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` \| `contextmenu` | `hover` |
| visible(v-model) | Whether the floating tooltip card is visible or not | boolean | `false` |
Expand Down
1 change: 1 addition & 0 deletions components/tooltip/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/Vyyeu8jq2/Tooltp.svg
| mouseLeaveDelay | 鼠标移出后延时多少才隐藏 Tooltip,单位:秒 | number | 0.1 |
| overlayClassName | 卡片类名 | string | 无 |
| overlayStyle | 卡片样式 | object | 无 |
| overlayInnerStyle | 卡片内容区域样式 | object | 无 |
| placement | 气泡框位置,可选 `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | top |
| trigger | 触发行为,可选 `hover/focus/click/contextmenu` | string | hover |
| visible(v-model) | 用于手动控制浮层显隐 | boolean | false |
Expand Down