解决谷歌浏览器 Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider markin...

在使用vue开发的时候谷歌报警告
Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive.

解决方法:

安装default-passive-events
npm i default-passive-events -S

在main.js中引入
import "default-passive-events"; //添加事件管理者'passive',来阻止'touchstart'事件,让页面更加流畅。 解决chrome下的warning问题

你可能感兴趣的:(解决谷歌浏览器 Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider markin...)