New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

sao_move

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sao_move

鼠标、触摸处理类;封装原生 `Touch events`、`MouseEvent` 事件

latest
Source
npmnpm
Version
2.1.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

封装原生 Touch eventsMouseEvent 事件

安装

npm install sao_move

使用简单

传入要监听的对象即可

const elecomnt = this.$refs.app

new SaoMove(elecomnt, (e) => {
    console.log(e)
})

回调参数内容

{
    "type": "touch",
    "event": "start",
    "identifier": 0,
    "x": 204.41114807128906,
    "y": 376.5450744628906,
    "moving_x": 0,
    "moving_y": 0,
    "total_x": 0,
    "total_y": 0,
    "e": "原生事件"
}
字段含义备注
type移动类型touch / mouse
event事件类型start / moving / stop
identifier触摸手指标识数字标识,鼠标类型为0
x实时x坐标
y实时y坐标
moving_x实时x位移
moving_y实时y位移
total_x累计x位移
total_y累计y位移

其他

  • total_x,total_y

是指从此次动作开始,到当前坐标的位移

  • moving_xmoving_x

是指从上个坐标到当前坐标的实时位移

  • identifier

通过identifier来区分每个手指单独的 start、moving、stop,多手指互不干扰

更新

  • 2.1 新增返回原生事件

Keywords

touch

FAQs

Package last updated on 13 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts