mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-13 12:13:10 +00:00
feat: make asset support es module
This commit is contained in:
parent
7677ad0166
commit
d56ed6bff1
@ -56,12 +56,13 @@ export function createSimulator(
|
|||||||
}
|
}
|
||||||
const id = asset.id ? ` data-id="${asset.id}"` : '';
|
const id = asset.id ? ` data-id="${asset.id}"` : '';
|
||||||
const lv = asset.level || level || AssetLevel.Environment;
|
const lv = asset.level || level || AssetLevel.Environment;
|
||||||
|
const scriptType = asset.scriptType ? ` type="${asset.scriptType}"` : '';
|
||||||
if (asset.type === AssetType.JSUrl) {
|
if (asset.type === AssetType.JSUrl) {
|
||||||
scripts[lv].push(
|
scripts[lv].push(
|
||||||
`<script src="${asset.content}"${id}></script>`,
|
`<script src="${asset.content}"${id}${scriptType}></script>`,
|
||||||
);
|
);
|
||||||
} else if (asset.type === AssetType.JSText) {
|
} else if (asset.type === AssetType.JSText) {
|
||||||
scripts[lv].push(`<script${id}>${asset.content}</script>`);
|
scripts[lv].push(`<script${id}${scriptType}>${asset.content}</script>`);
|
||||||
} else if (asset.type === AssetType.CSSUrl) {
|
} else if (asset.type === AssetType.CSSUrl) {
|
||||||
styles[lv].push(
|
styles[lv].push(
|
||||||
`<link rel="stylesheet" href="${asset.content}"${id} />`,
|
`<link rel="stylesheet" href="${asset.content}"${id} />`,
|
||||||
|
|||||||
@ -38,6 +38,7 @@ export interface AssetItem {
|
|||||||
device?: string;
|
device?: string;
|
||||||
level?: AssetLevel;
|
level?: AssetLevel;
|
||||||
id?: string;
|
id?: string;
|
||||||
|
scriptType?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AssetList = Array<Asset | undefined | null>;
|
export type AssetList = Array<Asset | undefined | null>;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user