fix(Swipe): dynamically render failed #7366

This commit is contained in:
chenjiahan 2020-10-21 14:28:57 +08:00
parent 1d6dac9915
commit c7a2a538e1
2 changed files with 5 additions and 2 deletions

View File

@ -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';

View File

@ -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,