SwipeEvent
轻扫手势事件。
属性
属性名 | 类型 | 说明 | 示例 |
---|---|---|---|
type | string | 事件类型 | type: 'swipe' |
state | number | 手势状态 | state: 0 // normal state: 1 // began state: 2 // changed state: 3 // ended state: 4 // cancelled |
timestamp | number | 时间戳 | timestamp: 1578973450142 |
direction | number | 滑动方向 | direction: 1 1:right, 2:left, 4:up, 8:down |
示例
js
let view = new View();
view.addEventListener('swipe', (event) => {
if (event.state == 3) {
console.log('direction:' + event.direction);
}
});