From 7ca0098a1be3a76bd6907babfedd38d8287529cb Mon Sep 17 00:00:00 2001 From: xjs Date: Mon, 8 Jun 2026 13:49:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/appComponents/Tooltip.vue | 49 +++++++++++++++---------- src/views/appComponents/WinCustomer.vue | 9 ++++- 2 files changed, 37 insertions(+), 21 deletions(-) diff --git a/src/views/appComponents/Tooltip.vue b/src/views/appComponents/Tooltip.vue index 404277a..5f6c5b8 100644 --- a/src/views/appComponents/Tooltip.vue +++ b/src/views/appComponents/Tooltip.vue @@ -12,26 +12,20 @@ - - - + {{ text }} + + @@ -55,8 +49,10 @@ const triggerRef = ref(null); const tipRef = ref(null); const visible = ref(false); + const positioned = ref(false); const isListening = ref(false); const timer = ref(null); + const revealFrame = ref(null); const gap = 10; const viewportPadding = 8; @@ -83,6 +79,13 @@ } }; + const clearRevealFrame = () => { + if (revealFrame.value) { + window.cancelAnimationFrame(revealFrame.value); + revealFrame.value = null; + } + }; + const clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max); const addPositionListeners = () => { @@ -104,21 +107,29 @@ if (visible.value) { calculatePosition(); + positioned.value = true; return; } clearTimer(); timer.value = window.setTimeout(async () => { timer.value = null; + positioned.value = false; visible.value = true; await nextTick(); calculatePosition(); + revealFrame.value = window.requestAnimationFrame(() => { + positioned.value = true; + revealFrame.value = null; + }); addPositionListeners(); }, props.delay); }; const hideTip = () => { clearTimer(); + clearRevealFrame(); + positioned.value = false; visible.value = false; removePositionListeners(); }; diff --git a/src/views/appComponents/WinCustomer.vue b/src/views/appComponents/WinCustomer.vue index 431cdc8..21be4d7 100644 --- a/src/views/appComponents/WinCustomer.vue +++ b/src/views/appComponents/WinCustomer.vue @@ -19,7 +19,9 @@ {{ index + 1 }}