mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-26 03:16:35 +08:00
[bugfix] Swipe: add defensive code (#2253)
This commit is contained in:
parent
f1742ec97f
commit
eacabe83a1
@ -220,9 +220,13 @@ export default create({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
swipes[0].offset = atLast && (delta < 0 || move > 0) ? trackSize : 0;
|
if (swipes[0]) {
|
||||||
swipes[count - 1].offset =
|
swipes[0].offset = atLast && (delta < 0 || move > 0) ? trackSize : 0;
|
||||||
atFirst && (delta > 0 || move < 0) ? -trackSize : 0;
|
}
|
||||||
|
|
||||||
|
if (swipes[count - 1]) {
|
||||||
|
swipes[count - 1].offset = atFirst && (delta > 0 || move < 0) ? -trackSize : 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (move && active + move >= -1 && active + move <= count) {
|
if (move && active + move >= -1 && active + move <= count) {
|
||||||
this.active += move;
|
this.active += move;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user