Explorar el Código

fix: fix the problem that it does not take effect when the noHorizontalPadding parameter type of Button is string

zhangyumei.0319 hace 3 años
padre
commit
6077f2c766
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      packages/semi-ui/iconButton/index.tsx

+ 3 - 0
packages/semi-ui/iconButton/index.tsx

@@ -80,6 +80,9 @@ class IconButton extends PureComponent<IconButtonProps> {
         } else if (noHorizontalPadding === true) {
             style.paddingLeft = 0;
             style.paddingRight = 0;
+        } else if (typeof noHorizontalPadding === 'string') {
+            noHorizontalPadding === 'left' && (style.paddingLeft = 0);
+            noHorizontalPadding === 'right' && (style.paddingRight = 0);
         }
 
         let finalChildren = null;