Merge branch '2.x' into dev

This commit is contained in:
chenjiahan
2020-11-15 15:38:22 +08:00
5 changed files with 44 additions and 51 deletions
+3 -3
View File
@@ -136,7 +136,7 @@ export default createComponent({
currentPosition = Math.min(currentPosition, -minOffset.value);
}
let targetOffset = Math.round(offset - currentPosition);
let targetOffset = offset - currentPosition;
if (!props.loop) {
targetOffset = range(targetOffset, minOffset.value, 0);
}
@@ -242,8 +242,8 @@ export default createComponent({
state.rect = rect;
state.swiping = true;
state.active = active;
state.width = Math.floor(+props.width || rect.width);
state.height = Math.floor(+props.height || rect.height);
state.width = +props.width || rect.width;
state.height = +props.height || rect.height;
state.offset = getTargetOffset(active);
children.forEach((swipe) => {
swipe.setOffset(0);