mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-24 18:36:51 +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.rect = rect;
|
||||||
this.swiping = true;
|
this.swiping = true;
|
||||||
this.active = active;
|
this.active = active;
|
||||||
this.computedWidth = Math.floor(+this.width || rect.width);
|
this.computedWidth = +this.width || rect.width;
|
||||||
this.computedHeight = Math.floor(+this.height || rect.height);
|
this.computedHeight = +this.height || rect.height;
|
||||||
this.offset = this.getTargetOffset(active);
|
this.offset = this.getTargetOffset(active);
|
||||||
this.children.forEach((swipe) => {
|
this.children.forEach((swipe) => {
|
||||||
swipe.offset = 0;
|
swipe.offset = 0;
|
||||||
@ -260,7 +260,7 @@ export default createComponent({
|
|||||||
currentPosition = Math.min(currentPosition, -this.minOffset);
|
currentPosition = Math.min(currentPosition, -this.minOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
let targetOffset = Math.round(offset - currentPosition);
|
let targetOffset = offset - currentPosition;
|
||||||
if (!this.loop) {
|
if (!this.loop) {
|
||||||
targetOffset = range(targetOffset, this.minOffset, 0);
|
targetOffset = range(targetOffset, this.minOffset, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user