From d74ded570c318c1e7a2122cd915af142d1dcdaa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=96=AA=E5=90=8D?= <942005050@qq.com> Date: Tue, 10 Oct 2023 19:51:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=8C=89=E9=92=AE=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=90=8E=E9=A2=9C=E8=89=B2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/index.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/utils/index.ts b/src/utils/index.ts index c73b8d2f4..0c00c2550 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -233,3 +233,13 @@ export const yuanToFen = (amount: string | number): number => { export const fenToYuan = (amount: string | number): number => { return Number((Number(amount) / 100).toFixed(2)) } + +// el-button 点击后强制失去焦点(颜色不恢复问题处理) 调用位置:绑定在el-button的点击事件 +export function clearButtonBlurHandle (e:any) { + if(!e || JSON.stringify(e) == '{}' || !e.target)return + let target = e.target; + if(target.nodeName == 'SPAN' || target.nodeName == 'I'){ + target = e.target.parentNode; + } + target.blur(); +} \ No newline at end of file