Skip to content
目录

SwipeEvent

轻扫手势事件。

属性

属性名类型说明示例
typestring事件类型type: 'swipe'
statenumber手势状态state: 0 // normal
state: 1 // began
state: 2 // changed
state: 3 // ended
state: 4 // cancelled
timestampnumber时间戳timestamp: 1578973450142
directionnumber滑动方向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);
    }
});