智能照明系统APP-本地串口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
LightingSystemApp-serial/.svn/pristine/72/729b09409188f46aba0af4fcdaf...

21 lines
425 B

3 years ago
import {
transformCSS
} from '../../upx'
export function parseStyleUnit (styles) {
let newStyles = {}
const stylesStr = JSON.stringify(styles)
if (~stylesStr.indexOf('upx') || ~stylesStr.indexOf('rpx')) {
try {
newStyles = JSON.parse(transformCSS(stylesStr))
} catch (e) {
newStyles = styles
console.error(e)
}
} else {
newStyles = JSON.parse(stylesStr)
}
return newStyles
}