vue中,解决chrome下,的warning, Added non-passive event listener to a scroll-blocking ‘mousewheel‘ event 问题


一、警告信息如下:
vue+element项目中,解决chrome下的passive警告问题

element-ui.common.js?5c96:9972 [Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952

二、问题解决
安装 default-passive-events
yarn add default-passive-events

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

参考:https://www.jianshu.com/p/23850d4cade8


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM