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