刷卡时Vue2 Tocuh事件被忽略,试图取消touchmove事件错误

问题描述

我正在使用vue2-touch-events插件为使用Cordova构建的Nuxt JS混合应用程序创建一些“类似原生”的滑动行为。我已经在屏幕的大部分区域中实现了一个元素(绝对定位),该元素一旦在$router上滑动即可推送到新页面

直到最近我发现控制台中发生错误时,它一直可以正常工作。

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

我不太确定为什么会遇到此错误,并尝试还原一些没有任何区别的内容。附带问题代码

HTML Vue JS标记
<span
  v-touch:swipe.right="swipePrevPage"
  v-touch:swipe.left="swipeNextPage"
  class="page-swipe-trigger">
</span>
实施方法
/**
 * Handle page swipe (next page)
 */
swipePrevPage() {
  if (this.page && this.id && this.$refs.hasPages[0].innerText === 'true') {
    if (this.prevPage != -1) {
      this.$router.push('/url/' + this.page + '/' + this.prevPage)
    } else {
      this.$router.push('/url/' + this.page)
    }
  }
},/**
 * Handle page swipe (next page)
 */
swipeNextPage() {
  if (this.page && this.id && this.$refs.hasPages[0].innerText === 'true') {
    if (this.nextPage < parseInt(this.$refs.getPages[0].innerText)) {
      this.$router.push('/url/' + this.page + '/' + this.nextPage)
    }
  }
}

出于参考目的,我正在使用插件2.3.0版,并对其进行如下配置...

import Vue from 'vue'
import Vue2TouchEvents from 'vue2-touch-events'

Vue.use(Vue2TouchEvents,{
  touchClass: 'touched',swipetolerance: 50
})

如果有人可以帮助我解决为什么出现此错误,则尝试滑动时会显示错误

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)