index.ts 299 B

123456789101112
  1. // @ts-nocheck
  2. import {isNumeric} from '../isNumeric'
  3. import {isDef} from '../isDef'
  4. /** 加单位 */
  5. export function addUnit(value?: string | number): string | undefined {
  6. if (!isDef(value)) {
  7. return undefined;
  8. }
  9. value = String(value);
  10. return isNumeric(value) ? `${value}px` : value;
  11. }