mirror of
https://github.com/element-plus/element-plus.git
synced 2025-01-18 10:59:10 +08:00
fix: value does not exist, warning appears (#5906)
This commit is contained in:
parent
bbe1cdcb13
commit
81bca48fd4
@ -4,11 +4,11 @@ import { debugWarn } from '../error'
|
||||
const SCOPE = 'utils-v2/vue/style'
|
||||
|
||||
export function addUnit(value: string | number, defaultUnit = 'px') {
|
||||
if (!value) return ''
|
||||
if (isString(value)) {
|
||||
return value
|
||||
} else if (isNumber(value)) {
|
||||
return `${value}${defaultUnit}`
|
||||
}
|
||||
debugWarn(SCOPE, 'binding value must be a string or number')
|
||||
return ''
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user