大飞_dafei

导航

scroll-view 滚动时报错Ignored attempt to cancel a touchmove event with cancelable=false

场景描述:

在uniapp中的弹窗pop中使用scroll-view频繁滚动出现报错
[Intervention]Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted 解决报错

 

解决办法:

因为事件冒泡, scroll-view 组件的 touchmove 事件可以传递到模态框。

给 scroll-view 取消冒泡 报错没了,问题成功解决。 

<scroll-view class="content" scroll-y @touchmove.stop>
    <view class="content-main">xxxxxxxxxxxx</view>
 </scroll-view>

其他参考链接: 解决 scroll-view 组件 [Intervention] 报错

posted on 2024-11-06 14:33  大飞_dafei  阅读(103)  评论(0编辑  收藏  举报