fix(Swipe): should render dynamic swipe item correctly (#8288)

This commit is contained in:
neverland
2021-03-05 15:33:17 +08:00
committed by GitHub
parent 08086c8002
commit d76567eeec
3 changed files with 73 additions and 5 deletions
+4 -5
View File
@@ -282,7 +282,9 @@ export default createComponent({
const rect = useRect(root);
active = Math.min(children.length - 1, active);
if (count.value) {
active = Math.min(count.value - 1, active);
}
state.rect = rect;
state.swiping = true;
@@ -430,10 +432,7 @@ export default createComponent({
(value) => initialize(+value)
);
watch(
() => children.length,
() => initialize(state.active)
);
watch(count, () => initialize(state.active));
watch(
() => props.autoplay,