mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-27 03:01:14 +08:00
06731d8e70
* fix(project): fix/1778-import-on-demand-not-working - Fix the issue that when building utils the functions are inlined * - remove unnecessary variable
16 lines
402 B
TypeScript
16 lines
402 B
TypeScript
import { isNumber } from '@element-plus/utils/util'
|
|
|
|
export const isValidWidthUnit = (val: string | number): boolean =>{
|
|
if(isNumber(val)){
|
|
return true
|
|
} else {
|
|
return ['px', 'rem', 'em', 'vw', '%', 'vmin', 'vmax'].some(unit =>
|
|
(val as string).endsWith(unit),
|
|
)
|
|
}
|
|
}
|
|
|
|
|
|
export const isValidComponentSize = (val: string) =>
|
|
['', 'large', 'medium', 'small', 'mini'].includes(val)
|