From 11401c70cd1950023237c9dacd55b6b4e310bdab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=B6=E7=91=9E?= Date: Thu, 26 May 2022 20:26:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89hover-class=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uview-ui/components/u-button/u-button.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/uview-ui/components/u-button/u-button.vue b/uview-ui/components/u-button/u-button.vue index 82c3a6f0..3b3d6f69 100644 --- a/uview-ui/components/u-button/u-button.vue +++ b/uview-ui/components/u-button/u-button.vue @@ -229,10 +229,12 @@ export default { // 当没有传bgColor变量时,按钮按下去的颜色类名 getHoverClass() { // 如果开启水波纹效果,则不启用hover-class效果 - if (this.loading || this.disabled || this.ripple || this.hoverClass) return ''; - let hoverClass = ''; - hoverClass = this.plain ? 'u-' + this.type + '-plain-hover' : 'u-' + this.type + '-hover'; - return hoverClass; + if (this.loading || this.disabled || this.ripple) { + return ''; + } else if (this.hoverClass) { + return this.hoverClass; + } + return this.plain ? 'u-' + this.type + '-plain-hover' : 'u-' + this.type + '-hover'; }, // 在'primary', 'success', 'error', 'warning'类型下,不显示边框,否则会造成四角有毛刺现象 showHairLineBorder() {