mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-10 09:56:20 +00:00
fix: 支持低代码组件样式
This commit is contained in:
parent
5050af7cb6
commit
6e64be13fa
@ -219,6 +219,15 @@ export class SimulatorRenderer implements BuiltinSimulatorRenderer {
|
|||||||
_schema.methods = {};
|
_schema.methods = {};
|
||||||
_schema.lifeCycles = {};
|
_schema.lifeCycles = {};
|
||||||
|
|
||||||
|
if (schema.componentName === 'Component' && (schema as ComponentSchema).css) {
|
||||||
|
const doc = window.document;
|
||||||
|
const s = doc.createElement('style');
|
||||||
|
s.setAttribute('type', 'text/css');
|
||||||
|
s.setAttribute('id', `Component-${schema.id || ''}`);
|
||||||
|
s.appendChild(doc.createTextNode((schema as ComponentSchema).css || ''));
|
||||||
|
doc.getElementsByTagName('head')[0].appendChild(s);
|
||||||
|
}
|
||||||
|
|
||||||
const node = host.document.createNode(_schema);
|
const node = host.document.createNode(_schema);
|
||||||
_schema = node.export(TransformStage.Render);
|
_schema = node.export(TransformStage.Render);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user