Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swipe细分的话可以有swipestart,swipemove,swipeend #59

Closed
hugetiny opened this issue Jul 15, 2021 · 6 comments
Closed

swipe细分的话可以有swipestart,swipemove,swipeend #59

hugetiny opened this issue Jul 15, 2021 · 6 comments

Comments

@hugetiny
Copy link

hugetiny commented Jul 15, 2021

对应pan的三个状态,一个是长按开始,一个是短按开始

swipestart,swipemove,swipeend

最近做手势项目,头痛死了快,官方也放弃维护官方手势库。

@any86
Copy link
Owner

any86 commented Jul 15, 2021

swipe是触点离开屏幕那一刻判断并触发的, 是个瞬时的状态, 所以就没有move end.

你说的官方是哪里啊?

@hugetiny
Copy link
Author

hugetiny commented Jul 15, 2021

swipe是触点离开屏幕那一刻判断并触发的, 是个瞬时的状态, 所以就没有move end.

你说的官方是哪里啊?

你现在swipe是从touchend或者mouseup开始算的我知道
我的逻辑是:

长按都是panstart panmove panend
短按都是swipestart,swipemove,swipeend或者叫pressstart,pressmove,pressend
比较清晰一点
官方手势库vue-touch啊 vue放弃维护了

@any86
Copy link
Owner

any86 commented Jul 15, 2021

swipe的逻辑是你按住后, 在短时间内滑动了一定的就距离就可以判断为swipe, 也可以理解为滑动速度到达一定值, 离开屏幕的时候才触发swipe, 所以在他之前你是拖拽了多久都不管的, 所以不是长按和短按的区别触发了swipe.

vue-touch应该包裹的hammer.js, hammer中的swipe这是这么判断的, 我还参考过swiper.js上对手势的定义, 他的swipe也是这个逻辑.

hammer.js早就不维护了, 所以vue-touch也就不可能在继续更新了.

@any86
Copy link
Owner

any86 commented Jul 15, 2021

所以我觉得你的需求应该是配合pan+swipe使用

@hugetiny
Copy link
Author

少年,Vue的手势库靠你了

@any86
Copy link
Owner

any86 commented Jul 15, 2021

━(`∀´)ノ亻!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants