Browse Source

处理按钮点击后颜色问题

master
陈薪名 1 year ago
parent
commit
d74ded570c
  1. 10
      src/utils/index.ts

10
src/utils/index.ts

@ -233,3 +233,13 @@ export const yuanToFen = (amount: string | number): number => {
export const fenToYuan = (amount: string | number): number => { export const fenToYuan = (amount: string | number): number => {
return Number((Number(amount) / 100).toFixed(2)) 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();
}
Loading…
Cancel
Save