:wave: 触摸手势库, 1kb~5kb, 兼容 PC/移动设备
中文 | 英文
二维码
npm i -S any-touchimport AnyTouch from 'any-touch';
// monitored element
const el = document.getElementById('box');
// Start monitoring gesture changes on el
const at = new AnyTouch(el);
// The pan event fires when dragging
at.on('pan', (e) => {
// e contains information such as displacement/velocity/direction
console.log(e);
});这里的平移事件称为 gesture event。e 是 event object,其中包含诸如“位置/速度/缩放/角度”等数据。
Simple any-scroll ⚡ Get Started Vue & Directives WeChat applet Load on demand Advanced :bulb: API Q & A
暂无开放 Issues,或尚未同步最近议题。