ElementUI报错(警告)
[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
问题原因
简述:在某次谷歌浏览器更新,优化了关于页面滚动的一些方法,使得页面更加流畅。Element建议使用此特性。
详细:dj0379的文章:让页面滑动流畅得飞起的新特性:Passive Event Listeners
解决步骤
- 项目中加入依赖"default-passive-events"
yarn add default-passive-events
- main.js中引入依赖
// 优化页面滚动
import 'default-passive-events'