報錯:
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(); }
.