[Violation] Added non-passive event listener to a scroll-blocking ‘touchstart‘ event. Consider marki

解决谷歌浏览器警告
[Violation] Added non-passive event listener to a scroll-blocking ‘touchstart‘ event. Consider marki_第1张图片

vue3项目中使用Element-Plus的表单form校验单的时候,浏览器出现以下警告:

[Violation] Added non-passive event listener to a scroll-blocking
‘touchmove’ event. Consider marking event handler as ‘passive’ to make the page more responsive.

安装插件

npm install default-passive-events -S

在main.ts引入

//添加事件管理者'passive',来阻止'touchstart'事件,让页面更加流畅。 解决chrome下的warning问题
import 'default-passive-events' 

你可能感兴趣的:(前端框架,javascript,vue.js)