UNPKG
jobsys-mpower
Version:
latest (0.0.7)
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
Enhanced component based on Taro & NutUI
github.com/jobsys/mpower-ui
jobsys/mpower-ui
jobsys-mpower
/
utils
/
style.js
14 lines
(10 loc)
•
232 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import
{ isNull, isUndefined }
from
"lodash-es"
const
genPixel
= (
num
) => {
if
(
isNull
(num) ||
isUndefined
(num)) {
return
"auto"
}
else
if
(!
isNaN
(num)) {
return
`
${num}
px`
}
return
num }
export
{ genPixel }