原因

  • 旧版 iOS 需要 双击放大,所以首次点击后会等待 300ms 判断用户是否 双击
    📌 解决方案
  1. 使用 FastClick.js(适用于旧版浏览器)
 1import FastClick from 'fastclick';
 2FastClick.attach(document.body);
  1. CSS 方案(适用于现代浏览器)
 1html {
 2  touch-action: manipulation;
 3}
  1. pointer-events: none 临时禁用点击
个人笔记记录 2021 ~ 2025