We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
用于在移动端监听手势划动,便于处理上下左右划动时对应的操作。
interface Options { threshold?: number; // 最小划动距离 maxTime?: number; // 快速划动最长时间 onSwipeLeft?: (event: TouchEvent) => void; onSwipeRight?: (event: TouchEvent) => void; onSwipeUp?: (event: TouchEvent) => void; onSWipeDown?: (event: TouchEvent) => void; } type useSwipeEvent = <T>(options: Options) => T;
const onSwipeLeft = () => { // page change } const onSwipeRight = () => { // page change }; useSwipeEvent({ threshold: 100, maxTime: 500, onSwipeLeft, onSwipeRight })
The text was updated successfully, but these errors were encountered:
No branches or pull requests
用于在移动端监听手势划动,便于处理上下左右划动时对应的操作。
API
Demo
使用场景
The text was updated successfully, but these errors were encountered: