From c7a2a538e13717f5e7cd3d2940f80cb3284423fc Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Wed, 21 Oct 2020 14:28:57 +0800 Subject: [PATCH] fix(Swipe): dynamically render failed #7366 --- src/number-keyboard/Key.tsx | 2 +- src/swipe/index.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/number-keyboard/Key.tsx b/src/number-keyboard/Key.tsx index b036a937a..46cb35b41 100644 --- a/src/number-keyboard/Key.tsx +++ b/src/number-keyboard/Key.tsx @@ -1,4 +1,4 @@ -import { PropType, ref } from 'vue'; +import { ref, PropType } from 'vue'; import { createNamespace } from '../utils'; import { useTouch } from '../composition/use-touch'; import Loading from '../loading'; diff --git a/src/swipe/index.js b/src/swipe/index.js index 92a8c4259..993b722d6 100644 --- a/src/swipe/index.js +++ b/src/swipe/index.js @@ -232,6 +232,7 @@ export default createComponent({ // initialize swipe position const initialize = (active = +props.initialSwipe) => { + console.log('initialize', children.length, active); if (!root.value || isHidden(root)) { return; } @@ -373,7 +374,9 @@ export default createComponent({ linkChildren({ size, props, count, activeIndicator }); - watch([() => children.length, () => props.initialSwipe], initialize); + watch([() => children.length, () => props.initialSwipe], () => { + initialize(); + }); watch( () => props.autoplay,