谷歌浏览器报错 [Intervention] Unable to preventDefault inside passive event listener due to target being ..

网上的解决办法一般为2种 . 

1. 修改css 

*{
    touch-action: none;
}
或者
* {
  touch-action: pan-y;
}

该方法测试无效

2. 修改js

在处理函数时写明{ passive: false }

window.addEventListener('touchmove', fn, { passive: false })

测试成功.

猜你喜欢

转载自blog.csdn.net/qq_37514029/article/details/107361626