mirror of
https://github.com/youzan/vant.git
synced 2025-10-17 00:14:18 +00:00
fix(Swipe): incorrect swipeTo animation (#4570)
This commit is contained in:
@@ -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
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user