Interger
Interger
  • 发布:2025-01-03 15:31
  • 更新:2025-01-03 20:32
  • 阅读:37

【报Bug】页面上下滑动的时候也会触发hover-class

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Windows

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

HBuilderX类型: 正式

HBuilderX版本号: 4.44

浏览器平台: Chrome

浏览器版本: 126.0.6478.127

项目创建方式: HBuilderX

示例代码:

<template>
<view class="content">
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
</view>
</template>

<script>
export default {
data() {
return {
title: 'Hello'
};
},
onLoad() {},
methods: {}
};
</script>

<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.area {
width: 100%;
padding: 80rpx 0;
background-color: #eeeeee;
}
.hoverClass{
background-color: #000000;
}
</style>

操作步骤:

<template>
<view class="content">
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
<view class="area" hover-class="hoverClass">哈哈哈哈</view>
</view>
</template>

<script>
export default {
data() {
return {
title: 'Hello'
};
},
onLoad() {},
methods: {}
};
</script>

<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.area {
width: 100%;
padding: 80rpx 0;
background-color: #eeeeee;
}
.hoverClass{
background-color: #000000;
}
</style>

预期结果:

页面滑动不会触发hover-class

实际结果:

页面滑动会触发hover-class

bug描述:

页面上下滑动的时候也会触发hover-class,问答社区看到官方人员回复,hover-class会先判断是否有页面滑动,滑动则不会触发hover-class,实测在H5以及安卓ios页面滑动都会触发hover-class

2025-01-03 15:31 负责人:无 分享
已邀请:
DCloud_UNI_OttoJi

DCloud_UNI_OttoJi - 日常回复 uni-app/x 问题,如果艾特我没看到,请主动私信

hover-class会先判断是否有页面滑动,滑动则不会触发hover-class

这个是哪个帖子回复的

  • Interger (作者)

    https://ask.dcloud.net.cn/question/188254

    2025-01-04 00:04

要回复问题请先登录注册