uniapp swiper 滑動報錯:Ignored attempt to cancel a touchmove event with cancelable=false
阿新 • • 發佈:2021-02-10
uniapp swiper 滑動報錯
報錯內容
Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.
<swiper class="swiper square-dot1" :autoplay="autoplay" cancelable="false" indicator-dots ="true" :duration="duration" v-if="guidePages">
<swiper-item class="swiper-action">
<view class="swiper-item">
<view class="swiper-item-img">
<image src="../../static/guide/1.png" mode="aspectFit" ></image>
</view>
<!-- <view class="swiper-item-img">
<image src="../../static/guide/2.jpg" mode="aspectFit"></image>
</view> -->
</view>
<view class="jump-over" @tap="launchFlag()">{{jumpover}}</ view>
</swiper-item>
</swiper>
解決方案
針對swiper-item新增一下樣式
.swiper-action {
touch-action: none;
}