mirror of
https://github.com/youzan/vant.git
synced 2025-12-25 02:02:01 +08:00
[new feature] Icon: size prop support number type
This commit is contained in:
@@ -50,7 +50,11 @@ export function isInDocument(element: HTMLElement): boolean {
|
||||
return document.body.contains(element);
|
||||
}
|
||||
|
||||
export function suffixPx(value: string | number): string {
|
||||
export function suffixPx(value?: string | number): string | undefined {
|
||||
if (!isDef(value)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
value = String(value);
|
||||
return isNumber(value) ? `${value}px` : value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user