From c36f7e701f94d7e31e141f12347e29785d2b2078 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Thu, 18 May 2023 07:23:46 +0800 Subject: [PATCH] fix: tour animated --- components/vc-tour/hooks/useTarget.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/vc-tour/hooks/useTarget.ts b/components/vc-tour/hooks/useTarget.ts index fad1873b0..d51488874 100644 --- a/components/vc-tour/hooks/useTarget.ts +++ b/components/vc-tour/hooks/useTarget.ts @@ -43,6 +43,10 @@ export default function useTarget( const [posInfo, setPosInfo] = useState(null); const updatePos = () => { + if (!open.value) { + setPosInfo(null); + return; + } if (targetElement.value) { // Exist target element. We should scroll and get target position if (!isInViewPort(targetElement.value) && open.value) {