From 8f771d4a8c226b482199429804c9a9e8fd5dd1b3 Mon Sep 17 00:00:00 2001 From: qq_40591925 Date: Fri, 4 Jul 2025 18:11:57 +0800 Subject: [PATCH] Auto Commit --- src/App.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/App.vue b/src/App.vue index 4674f6e..404c372 100644 --- a/src/App.vue +++ b/src/App.vue @@ -12,7 +12,6 @@ const startTime = performance.now(); const startScroll = Dom.scrollLeft; const duration = 150; - isSnap.value = false; const animate = (timestamp: number) => { const progress = (timestamp - startTime) / duration; if (progress < 1) { @@ -38,6 +37,7 @@ const container = scrollContainer.value const containerWidth = container?.clientWidth || 0; const currentScroll = container?.scrollLeft || 0; + isSnap.value = false; let scrollLeft = 0; if(type==='prev'){ scrollLeft = currentScroll - containerWidth; @@ -46,7 +46,9 @@ } scrollLeft=scrollLeft<0?0:scrollLeft // 有动画 - changeScroll(container as HTMLElement,scrollLeft) + setTimeout(()=>{ + changeScroll(container as HTMLElement, scrollLeft) + },0) } const handleScroll = () => { -- GitLab