fix monaco
This commit is contained in:
parent
2515a66fc3
commit
f7070a9f08
|
|
@ -160,14 +160,13 @@ export const EdScriptMonaco: FC<{}> = () => {
|
||||||
const prop = meta.item.component?.props[prop_name];
|
const prop = meta.item.component?.props[prop_name];
|
||||||
|
|
||||||
if (!!prop && typeof prop.typings === "string") {
|
if (!!prop && typeof prop.typings === "string") {
|
||||||
try {
|
|
||||||
const typings_src = prop.typings.substring(
|
|
||||||
`const typings = `.length
|
|
||||||
);
|
|
||||||
const typings_fn = new Function(
|
const typings_fn = new Function(
|
||||||
"active",
|
"active",
|
||||||
`return ${typings_src}`
|
`\
|
||||||
|
${prop.typings};
|
||||||
|
return typings;`
|
||||||
);
|
);
|
||||||
|
try {
|
||||||
const typings = typings_fn(active);
|
const typings = typings_fn(active);
|
||||||
if (typeof typings === "object") {
|
if (typeof typings === "object") {
|
||||||
for (const [k, v] of Object.entries(typings)) {
|
for (const [k, v] of Object.entries(typings)) {
|
||||||
|
|
@ -176,7 +175,9 @@ export const EdScriptMonaco: FC<{}> = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {
|
||||||
|
console.log(typings_fn.toString())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue