1. @any-touch/core
any-touch核心程序, 主要用来兼容Mouse/Touch事件.
@any-touch/core
Package: @any-touch/core
Created by: any86
Last modified: Tue, 24 May 2022 06:43:58 GMT
Version: 2.2.0
License: MIT
Downloads: 5,957
Repository: https://github.com/any86/any-touch

Install

npm install @any-touch/core
yarn add @any-touch/core

@any-touch/core

🤖核心组件, 主要用来把Mouse/Touch输入变成统一的输出, 实现PC/Mobile端的兼容, 提供了"at:"开头的兼容事件.

 import Core from '@any-touch/core';
const at = new Core(el);
// 兼容Mouse/Touch
at.on('at', (ev) => {
    // ev包含位置/时间/事件对象等属性.
});
// start / move / end / cancel
at.on('at:start', onStart);
at.on('at:move', onMove);
at.on('at:end', onEnd);
at.on('at:cancel', onCancel);

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code