mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-02 19:28:14 +08:00
chore(utils): remove unnecessary as string (#4805)
This commit is contained in:
parent
7caa13e80c
commit
dda60bd200
@ -3,13 +3,12 @@ import { isNumber } from './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)
|
||||
) || (val as string).startsWith('calc')
|
||||
)
|
||||
}
|
||||
return (
|
||||
['px', 'rem', 'em', 'vw', '%', 'vmin', 'vmax'].some((unit) =>
|
||||
val.endsWith(unit)
|
||||
) || val.startsWith('calc')
|
||||
)
|
||||
}
|
||||
|
||||
export const isValidComponentSize = (val: string) =>
|
||||
|
Loading…
Reference in New Issue
Block a user