uni-app 微信小程序 小米15 spro 运行到手机上面 swiper 嵌套 scroll-view 无法滑动

uni-app 微信小程序 小米15 spro 运行到手机上面 swiper 嵌套 scroll-view 无法滑动

项目信息 详情
产品分类 uniapp/小程序/微信
PC开发环境 Windows
操作系统版本 windows10
HBuilderX类型 正式
HBuilderX版本 4.66
第三方开发者工具版本 1.06.2504010
基础库版本 3.8.10
项目创建方式 HBuilderX

示例代码:

小米15 spro 运行到手机上面,微信小程序, swiper 嵌套 scroll-view ,swiper滑动一次后,无法继续滑动页面卡死,其他手机都可以正常使用

操作步骤:

小米15 spro 运行到手机上面,微信小程序, swiper 嵌套 scroll-view ,swiper滑动一次后,无法继续滑动页面卡死,其他手机型号都可以正常使用

预期结果:

正常使用

实际结果:

无法使用

bug描述:

小米15 spro 运行到手机上面,微信小程序, swiper 嵌套 scroll-view ,swiper滑动一次后,无法继续滑动页面卡死,其他手机都可以正常使用

App下载地址或H5网址:

[官方插件 新闻资讯模板APP模版可以复现,其他的插件,只要是swiper嵌套 scroll-view一样可以复现](//ask.dcloud.net.cn/官方插件 新闻资讯模板APP模版可以复现,其他的插件,只要是swiper嵌套 scroll-view一样可以复现)


更多关于uni-app 微信小程序 小米15 spro 运行到手机上面 swiper 嵌套 scroll-view 无法滑动的实战教程也可以访问 https://www.itying.com/category-93-b0.html

2 回复

试试原生微信小程序是否有此问题

更多关于uni-app 微信小程序 小米15 spro 运行到手机上面 swiper 嵌套 scroll-view 无法滑动的实战教程也可以访问 https://www.itying.com/category-93-b0.html


这是一个已知的 uni-app 在特定机型上的兼容性问题。在小米15等部分安卓机型上,swiper 嵌套 scroll-view 确实会出现滑动冲突导致页面卡死。

解决方案:

  1. 添加 touch 事件阻止冒泡 在 scroll-view 上添加 @touchstart.stop@touchmove.stop 事件阻止事件冒泡:

    <scroll-view 
      @touchstart.stop 
      @touchmove.stop
      scroll-y
    >
    
  2. 使用 enhanced 属性 在 swiper 上启用增强模式:

    <swiper enhanced>
回到顶部