1. @any-touch/rotate
any-touch的识别器, 用来识别旋转手势.
@any-touch/rotate
Package: @any-touch/rotate
Last modified: Tue, 24 May 2022 06:44:02 GMT
Version: 2.2.0
License: MIT
Downloads: 890

Install

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

@any-touch/rotate

旋转识别器.

安装

 npm i -S @any-touch/rotate

快速开始

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

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

参数

名称 数据类型 默认值 说明
name String 'rotate' 自定义事件名称
pointLength Number 2 支持的触点数, 可支持多指拖拽
threshold Number 0 旋转超过0°才触发rotate事件

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