mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Swipe): dynamically render failed #7366
This commit is contained in:
parent
1d6dac9915
commit
c7a2a538e1
@ -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';
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user