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 'pas
·
一、警告信息如下:
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问题
更多推荐
已为社区贡献27条内容
所有评论(0)