fix(tooltip): add a default value for the contentMaxHeight property (#3192)

This commit is contained in:
申君健 2025-03-26 01:10:19 -07:00 committed by GitHub
parent 3c8a5cbfe4
commit 4960a6a01f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 6 additions and 6 deletions

View File

@ -10,7 +10,6 @@
}
&__content-wrapper {
max-height: 50vh;
@apply overflow-auto;
}

View File

@ -27,7 +27,6 @@
}
&__content-wrapper {
max-height: var(--tv-Tooltip-content-max-height);
overflow: auto;
}

View File

@ -75,6 +75,4 @@
--tv-Tooltip-padding-x: var(--tv-space-xl, 16px);
// 文字提示错误图标色
--tv-Tooltip-validate-icon-color: var(--tv-color-error-icon, #f23030);
// 文本内容容器最大高度
--tv-Tooltip-content-max-height: 50vh;
}

View File

@ -86,7 +86,8 @@ export const tooltipProps = {
default: () => 'next'
},
contentMaxHeight: {
type: String
type: String,
default: () => '80vh'
}
}
export default defineComponent({

View File

@ -96,6 +96,9 @@ export default defineComponent({
zIndex: {
type: String,
default: () => 'next'
},
contentMaxHeight: {
type: String
}
},
setup(props, context) {
@ -160,7 +163,7 @@ export default defineComponent({
aria-hidden={this.disabled || !this.state.showPopper ? 'true' : 'false'}
onMouseenter={() => mouseenter()}
onMouseleave={() => mouseleave()}>
{content}
<div style={`overflow:auto; max-height:${this.contentMaxHeight}`}>{content}</div>
{this.visibleArrow ? (
<div
x-arrow