Unable to preventDefault inside

2019-10-19  本文已影响0人  holidayPenguin

今天在使用 iSlider.js 时出现这个错误,

iSlider.js:226 Unable to preventDefault inside passive event listener invocation.

解决方法如下:

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

为什么要这样做查看下面的文章

https://juejin.im/post/5ad804c1f265da504547fe68
https://developer.mozilla.org/zh-CN/docs/Web/API/EventTarget/addEventListener
https://developers.google.com/web/updates/2016/06/passive-event-listeners?hl=zh-cn
https://blog.csdn.net/Beamon__/article/details/89046558

上一篇 下一篇

猜你喜欢

热点阅读