mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Swipe): incorrect swipeTo animation (#4570)
This commit is contained in:
parent
0fe9874379
commit
a70c0ac5f4
@ -254,8 +254,15 @@ export default createComponent({
|
|||||||
this.correctPosition();
|
this.correctPosition();
|
||||||
|
|
||||||
doubleRaf(() => {
|
doubleRaf(() => {
|
||||||
|
let targetIndex;
|
||||||
|
if (this.loop && index === this.count) {
|
||||||
|
targetIndex = this.active === 0 ? 0 : index;
|
||||||
|
} else {
|
||||||
|
targetIndex = index % this.count;
|
||||||
|
}
|
||||||
|
|
||||||
this.move({
|
this.move({
|
||||||
pace: (index % this.count) - this.active,
|
pace: targetIndex - this.active,
|
||||||
emitChange: true
|
emitChange: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user