mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 09:41:57 +00:00
fix: 兼容 rpx
This commit is contained in:
parent
9031ccdec7
commit
5050af7cb6
@ -260,7 +260,9 @@ function appendStyleNode(props: any, styleProp: any, cssClass: string, cssId: st
|
||||
s.setAttribute('id', cssId);
|
||||
doc.getElementsByTagName('head')[0].appendChild(s);
|
||||
|
||||
s.appendChild(doc.createTextNode(styleProp.replace(/:root/g, '.' + cssClass)));
|
||||
s.appendChild(doc.createTextNode(styleProp.replace(/(\d+)rpx/g, (a, b) => {
|
||||
return `${b / 2}px`;
|
||||
}).replace(/:root/g, '.' + cssClass)));
|
||||
}
|
||||
}
|
||||
designer.addPropsReducer(stylePropsReducer, TransformStage.Render);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user