5***@qq.com
5***@qq.com
  • 发布:2022-03-26 19:38
  • 更新:2022-03-27 21:09
  • 阅读:349

【报Bug】监听 @mouseenter事件后 uni-h5.es 异常报错

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 12.0.1

HBuilderX类型: 正式

HBuilderX版本号: 3.3.13

手机系统: 全部

手机厂商: 华为

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

测试过的手机:

pc网站应用

操作步骤:

pc端监听 @mouseenter 和 @mouseleave 事件 (列表中的每个item都监听)
然后鼠标快速在不同item之间移动

预期结果:

无异常 正常触发

实际结果:

报错
vue.runtime.esm.js:1348 Uncaught TypeError: Cannot read properties of null (reading 'offsetWidth')
at uni-h5.es.js:6274:25
at callWithErrorHandling (vue.runtime.esm.js:1284:22)
at callWithAsyncErrorHandling (vue.runtime.esm.js:1293:21)
at HTMLDivElement.invoker (vue.runtime.esm.js:9394:13)

bug描述:

pc端监听 @mouseenter 和 @mouseleave 事件后
<view v-for="(photo,index) in photoList" id="photo-item" class="photo-item" :style="{width:photoWidth+'%'}" @click="onPhotoClick(index)" @mouseenter="photoList[index].hover = true" @mouseleave="photoList[index].hover = false">

鼠标在移动过程中会大量出现下面的异常

vue.runtime.esm.js:1348 Uncaught TypeError: Cannot read properties of null (reading 'offsetWidth')
at uni-h5.es.js:6274:25
at callWithErrorHandling (vue.runtime.esm.js:1284:22)
at callWithAsyncErrorHandling (vue.runtime.esm.js:1293:21)
at HTMLDivElement.invoker (vue.runtime.esm.js:9394:13)

异常指向的地方如附件

2022-03-26 19:38 负责人:无 分享
已邀请:
小枫叶

小枫叶 - 外包接单加v:wlmk1234567 注明来意

给个能复现的demo

该问题目前已经被锁定, 无法添加新回复