mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 02:31:21 +00:00
[Improvement] CellSwipe: optimzie animation fluency (#685)
This commit is contained in:
@@ -74,11 +74,11 @@ export function triggerTouch(wrapper, eventName, x, y) {
|
||||
el.dispatchEvent(event);
|
||||
}
|
||||
|
||||
export function dragHelper(el, position) {
|
||||
export function dragHelper(el, x = 0, y = 0) {
|
||||
triggerTouch(el, 'touchstart', 0, 0);
|
||||
triggerTouch(el, 'touchmove', 0, position / 4);
|
||||
triggerTouch(el, 'touchmove', 0, position / 3);
|
||||
triggerTouch(el, 'touchmove', 0, position / 2);
|
||||
triggerTouch(el, 'touchmove', 0, position);
|
||||
triggerTouch(el, 'touchend', 0, position);
|
||||
triggerTouch(el, 'touchmove', x / 4, y / 4);
|
||||
triggerTouch(el, 'touchmove', x / 3, y / 3);
|
||||
triggerTouch(el, 'touchmove', x / 2, y / 2);
|
||||
triggerTouch(el, 'touchmove', x, y);
|
||||
triggerTouch(el, 'touchend', x, y);
|
||||
}
|
||||
|
Reference in New Issue
Block a user