vue使用swiper模块滑动时报错:[Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example becaus

一世执手 提交于 2019-12-05 10:00:54

报错:

vue报这个错 
[Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted

方案1:使用css3

touch-action: none;

属性:

touch-action :当你触摸并按住触摸目标时候,禁止或显示系统默认菜单。 
touch-action取值有一下两种 
none:系统默认菜单被禁用 
default:系统默认菜单不被禁用

 

方案2:修改源文件

找到 swiper原文件,node_modules=》swiper 下面的 swiper.js,第2795行 屏蔽  // e.preventDefault();,不再报错了。

swiper.allowClick = false;

// e.preventDefault();

if (params.touchMoveStopPropagation && !params.nested) {

e.stopPropagation();

}

 

 

 

 

 

 

 

.

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!