- 当前 Bug 的表现(可附上截图)
当cover-view中嵌套一个或多个button组件时,指定的hover-class样式将无法正确在安卓手机中应用——这个样式目前可以在模拟器中正确应用到。
模拟器可以正确模拟这个效果
但是到了安卓手机上就不会应用,依旧保持了按钮的原始的样式配色。
因为没有iOS设备,所以不能确定iOS设备是否也会如此。
- 预期表现
在cover-view中嵌套的button组件设置了hover-class,点击按钮后应该应用hover-class指定的样式。
- 最简复现 Demo
通过以下两段代码复现这个问题,我在2台台式计算机1台笔记本电脑上都这样试过,应该不是开发工具的锅
index.wxml
<cover-view class=".cov"> <button class="btn" hover-class="btn_tap">Hello World!</button> </cover-view> <button class="btn" hover-class="btn_tap">Hello World!</button> |
index.wxss
.cov { height: 20vh; background-color: red; } .btn { color: white; background-color: blue; } .btn_tap { color: black; background-color: azure; } |
- 我的安卓手机信息
{ "screenWidth": 360, "errMsg": "getSystemInfo:ok", "locationEnabled": true, "statusBarHeight": 24, "pixelRatio": 3, "notificationAuthorized": true, "system": "Android 7.0", "cameraAuthorized": true, "windowWidth": 360, "deviceOrientation": "portrait", "bluetoothEnabled": false, "brand": "xiaomi", "version": "7.0", "screenHeight": 640, "fontSizeSetting": 16, "language": "zh_CN", "locationAuthorized": true, "wifiEnabled": true, "windowHeight": 568, "microphoneAuthorized": true, "model": "Redmi Note 4X", "platform": "android", "SDKVersion": "2.5.0"} |
======================================================================
代码片断已经上传,这里再说一个比较邪门的问题……
在手机扫码代码片断后,点击button的确变色了,但是样式变不回去了,即便设置了hover-stay-time={{70}}也不行……
另外我发现点击button的时候相当于判定点到了cover-view和button,这应该也是有问题吧……?

麻烦提供下代码片段:https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html
老师你好,我修正了帖子内容,增加了代码段。另外就是代码段的表现不知为什么和普通的小程序的表现不太一样……
我也更新了刚才代码段中遇到的问题,供你们参考