This commit is contained in:
Rizky 2024-03-30 16:30:08 +07:00
parent 772e4adaae
commit 78b9b95c70
1 changed files with 7 additions and 2 deletions

View File

@ -67,11 +67,15 @@ export const EdPropInstanceOptions: FC<{
if (meta.item.script?.props) { if (meta.item.script?.props) {
for (const [k, v] of Object.entries(meta.item.script?.props)) { for (const [k, v] of Object.entries(meta.item.script?.props)) {
eval(`try { arg.${k} = ${v.value} } catch(e) { console.error("arg", e); }`); eval(
`try { arg.${k} = ${v.value} } catch(e) { console.error("arg", e); }`
);
} }
} else if (meta.item.component) { } else if (meta.item.component) {
for (const [k, v] of Object.entries(meta.item.component.props)) { for (const [k, v] of Object.entries(meta.item.component.props)) {
eval(`try { arg.${k} = ${v.valueBuilt} } catch(e) { console.error("arg", e); }`); eval(
`try { arg.${k} = ${v.valueBuilt} } catch(e) { console.error("arg", e); }`
);
} }
} }
eval(` eval(`
@ -93,6 +97,7 @@ else metaOptions = resOpt;
local.loading = true; local.loading = true;
const res = local.metaFn(); const res = local.metaFn();
const callback = (e: any) => { const callback = (e: any) => {
console.log(name, e);
local.loading = false; local.loading = false;
local.loaded = e; local.loaded = e;
local.render(); local.render();