[Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example becaus

使用vue-awesome-swiper时报的错

1、[Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.

解决方案:
给body加上ontouchstart

这个操作是进行手机端兼容处理的,防止伪类:active失效。

在这里插入图片描述

2、Module not found: Error: Cannot resolve module 'swiper/css/swiper.css'

一开始是根据github上的swiper vue-awesome-swiper教程安装,安装完运行npm run dev发现一直报这个错,查了node_modules下的swiper根本没有css这个目录,后来在npm install swiper vue-awesome-swiper --save运行后控制台出现提示:vue-awesome-swiper@4.1.1要和swiper@5.2.0搭配使用才有效

解决方案:

npm i vue-awesome-swiper  -S
npm i swipre@5.2.0 -S

运行后正常,而且能找到swiper/css/swiper.css目录了

3 轮播图根据官网配置自动轮播,也是没有自动轮播

原因:版本问题,不同的swiper版本api不同,所以要看对应的swiper版本的api

4移动端常见的一些兼容性问题
链接:移动端常见的一些兼容性问题

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值