This commit is contained in:
Rizky 2024-04-03 22:07:21 +07:00
parent 5f02f9ed7a
commit e45b53c0ae
3 changed files with 26 additions and 17 deletions

File diff suppressed because one or more lines are too long

View File

@ -76,6 +76,14 @@ export const EdPropInstanceOptions: FC<{
eval( eval(
`try { arg.${k} = ${v.valueBuilt} } catch(e) { console.error("arg", e); }` `try { arg.${k} = ${v.valueBuilt} } catch(e) { console.error("arg", e); }`
); );
if (v.content) {
eval(
`try { arg.__${k} = ${JSON.stringify(
v.content
)} } catch(e) { console.error("arg", e); }`
);
}
} }
} }
@ -83,10 +91,12 @@ export const EdPropInstanceOptions: FC<{
...Object.keys(arg), ...Object.keys(arg),
"local", "local",
` `
try {
const resOpt = ${cprop.meta.optionsBuilt || cprop.meta.options}; const resOpt = ${cprop.meta.optionsBuilt || cprop.meta.options};
if (typeof resOpt === 'function') local.metaFn = resOpt; if (typeof resOpt === 'function') local.metaFn = resOpt;
else local.options = resOpt;` else local.options = resOpt;
} catch(e) { console.error(e); }`
); );
res(...Object.values(arg), local); res(...Object.values(arg), local);
} catch (e) { } catch (e) {

View File

@ -102,7 +102,6 @@ export const viEvalProps = (
}, },
}; };
arg[`__${name}`] = prop;
arg[name] = val; arg[name] = val;
if (passprop) { if (passprop) {