Skip to content

Latest commit

 

History

History
23 lines (21 loc) · 682 Bytes

File metadata and controls

23 lines (21 loc) · 682 Bytes

@any-touch/pinch

缩放识别器.

快速开始

// 只加载pinch识别器(拖拽)
import Core from '@any-touch/core';
import Pinch from '@any-touch/pinch';
Core.use(Pinch, 参数)
const at = new Core(el);
// 拖拽
at.on('pinch', (ev) => {
    // ev包含位置/速度/方向等信息
});

⚠️注意: 执行npm i any-touch后, @any-touch/core和@any-touch/pinch便已自动安装, 直接引入即可.

参数

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