Skip to content

Commit 4aa3088

Browse files
committed
fix(tooltip): add maxWidth prop
1 parent 29a4f8e commit 4aa3088

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/tooltip/Tooltip.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import type { TooltipContentProps } from 'reka-ui'
33
import ThemeWrapper from '../provider/ThemeWrapper.vue'
44
55
export interface TooltipProps extends TooltipContentProps {
6-
to?: string | HTMLElement
6+
/** The content associated with the tooltip. */
77
content?: string
8+
/** The max width of the tooltip popup. */
9+
maxWidth?: string
810
}
911
</script>
1012

@@ -39,7 +41,7 @@ defineOptions({
3941
>
4042
<slot></slot>
4143
</TooltipTrigger>
42-
<TooltipPortal :to="props.to">
44+
<TooltipPortal>
4345
<ThemeWrapper>
4446
<TooltipContent
4547
class="ui-Tooltip"
@@ -54,6 +56,7 @@ defineOptions({
5456
:side="props.side"
5557
:side-offset="props.sideOffset"
5658
:sticky="props.sticky"
59+
:style="{maxWidth: props.maxWidth}"
5760
>
5861
<slot name="content">
5962
<p

0 commit comments

Comments
 (0)