Skip to content

Commit

Permalink
fix(Icon): 修复图标高度异常
Browse files Browse the repository at this point in the history
  • Loading branch information
lingting committed Oct 13, 2021
1 parent 9ae9458 commit 3a1248f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/Icon/icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ const Icon: React.FC<IconProps> = (props: IconProps) => {
style={{
...style,
cursor: style?.cursor || 'pointer',
lineHeight: style?.lineHeight || style?.fontSize,
lineHeight:
style?.lineHeight ||
(style?.fontSize && !style.fontSize.toString().endsWith('px')
? `${style.fontSize}px`
: style?.fontSize),
}}
>
<svg
Expand Down

0 comments on commit 3a1248f

Please sign in to comment.