mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-24 02:16:12 +08:00
12 lines
274 B
TypeScript
12 lines
274 B
TypeScript
import { isDef } from '..';
|
|
import { isNumber } from '../validate/number';
|
|
|
|
export function suffixPx(value?: string | number): string | undefined {
|
|
if (!isDef(value)) {
|
|
return undefined;
|
|
}
|
|
|
|
value = String(value);
|
|
return isNumber(value) ? `${value}px` : value;
|
|
}
|