1. Install

npm install --save-dev react-fastclick-alt

2. 用法

将元素或者component放在  <FastClick>...</FastClick> 中

import React from 'react';
import FastClick from 'react-fastclick-alt';
import ReactDOM from 'react-dom';
ReactDOM.render(<FastClick><MyApp/></FastClick>, document.getElementById('app'));

3. 监测到tap事件后会阻止冒泡  event.stopPropagation() 

4. 两个参数  

  threshold    在px中不能再转换为点击之前,触摸可以移动多远。 默认为15px。

  timeThreshold   在不能再将点击转换为点击之前可以持续点击多长时间,以毫秒为单位。 默认为125毫秒。

相关文章:

  • 2021-12-30
  • 2022-01-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
  • 2022-12-23
猜你喜欢
  • 2021-11-19
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案