1. @any-touch/swipe
any-touch的识别器, 用来识别划动手势.
@any-touch/swipe
Package: @any-touch/swipe
Last modified: Tue, 24 May 2022 06:44:04 GMT
Version: 2.2.0
License: MIT
Downloads: 885

Install

npm install @any-touch/swipe
yarn add @any-touch/swipe

@any-touch/swipe

快划识别器.

安装

 npm i -S @any-touch/swipe

快速开始

 // 只加载rotate识别器(旋转)
import Core from '@any-touch/core';
import swipe from '@any-touch/swipe';
const at = new Core(el);
at.use(swipe, 参数)

// 旋转
at.on('swipe', (event) => {
    // event包含位置/速度/方向等信息
});

参数

名称 数据类型 默认值 说明
name String 'swipe' 自定义事件名称
pointLength Number 1 支持的触点数, 可支持多指触发
threshold Number 10 触点离开前, 按压移动的距离超过10px才能触发事件
velocity Number 0.3 快划超过30px/ms才触发事件

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code