mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Swipe): leak when width has decimal (#7562)
This commit is contained in:
parent
66204dfcf1
commit
5b4e063fa9
@ -167,8 +167,8 @@ export default createComponent({
|
||||
this.rect = rect;
|
||||
this.swiping = true;
|
||||
this.active = active;
|
||||
this.computedWidth = Math.floor(+this.width || rect.width);
|
||||
this.computedHeight = Math.floor(+this.height || rect.height);
|
||||
this.computedWidth = +this.width || rect.width;
|
||||
this.computedHeight = +this.height || rect.height;
|
||||
this.offset = this.getTargetOffset(active);
|
||||
this.children.forEach((swipe) => {
|
||||
swipe.offset = 0;
|
||||
@ -260,7 +260,7 @@ export default createComponent({
|
||||
currentPosition = Math.min(currentPosition, -this.minOffset);
|
||||
}
|
||||
|
||||
let targetOffset = Math.round(offset - currentPosition);
|
||||
let targetOffset = offset - currentPosition;
|
||||
if (!this.loop) {
|
||||
targetOffset = range(targetOffset, this.minOffset, 0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user