From 335930bb5c5668386e5d20ab977c916f36b4a7af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?w=C5=AB=20y=C4=81ng?= Date: Wed, 11 Sep 2024 18:54:01 +0800 Subject: [PATCH] fix(table): fix ellpsis status (#4555) --- src/table/ellipsis.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/table/ellipsis.tsx b/src/table/ellipsis.tsx index bc83aeb9aa..b04eebb099 100644 --- a/src/table/ellipsis.tsx +++ b/src/table/ellipsis.tsx @@ -80,7 +80,9 @@ export default defineComponent({ const onTriggerMouseleave = () => { if (!root.value) return; }; - + const handleVisibleChange = (v: boolean) => { + if (!v) flag.value = false; + }; // 使用 debounce 有两个原因:1. 避免 safari/firefox 等浏览器不显示省略浮层;2. 避免省略列快速滚动时,出现一堆的省略浮层 const onMouseAround = debounce((e: MouseEvent) => { e.type === 'mouseleave' ? onTriggerMouseleave() : onTriggerMouseenter(); @@ -93,11 +95,13 @@ export default defineComponent({ ellipsisClasses, innerEllipsisClassName, onMouseAround, + handleVisibleChange, }; }, render() { const cellNode = renderContent(this, 'default', 'content'); + const ellipsisContent = (
{ellipsisContent};