From 89d08f2d0675c2d570ea0915052532a819f0d23c Mon Sep 17 00:00:00 2001 From: neverland Date: Sun, 12 Sep 2021 09:31:36 +0800 Subject: [PATCH] fix(Popup): failed to autoplay when activated (#9452) --- packages/vant/src/swipe/Swipe.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/vant/src/swipe/Swipe.tsx b/packages/vant/src/swipe/Swipe.tsx index ffa36b5d5..b96cfd1da 100644 --- a/packages/vant/src/swipe/Swipe.tsx +++ b/packages/vant/src/swipe/Swipe.tsx @@ -279,6 +279,8 @@ export default defineComponent({ children.forEach((swipe) => { swipe.setOffset(0); }); + + autoplay(); }; const resize = () => initialize(state.active); @@ -417,7 +419,7 @@ export default defineComponent({ ); watch(count, () => initialize(state.active)); - watch([count, () => props.autoplay], autoplay); + watch(() => props.autoplay, autoplay); watch([windowSize.width, windowSize.height], resize); watch(usePageVisibility(), (visible) => { if (visible === 'visible') {