vue使用swiper模塊滑動時報錯:[Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example becaus


報錯:

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();

}

 

 

 

 

 

 

 

.

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM