This commit is contained in:
Rizky 2024-03-30 16:00:44 +07:00
parent 0ae3e6b1a5
commit ced82f7fa0
4 changed files with 6 additions and 7 deletions

View File

@ -76,11 +76,11 @@ export const EdSidePropInstance: FC<{ meta: IMeta }> = ({ meta }) => {
const arg: any = { ...active.scope };
if (meta.item.script?.props) {
for (const [k, v] of Object.entries(meta.item.script?.props)) {
eval(`try { arg.${k} = ${v.value} } catch(e) {}`);
eval(`try { arg.${k} = ${v.value} } catch(e) { console.error("arg", e); }`);
}
} else if (meta.item.component) {
for (const [k, v] of Object.entries(meta.item.component.props)) {
eval(`try { arg.${k} = ${v.valueBuilt} } catch(e) {}`);
eval(`try { arg.${k} = ${v.valueBuilt} } catch(e) { console.error("arg", e); }`);
}
}

View File

@ -31,11 +31,11 @@ export const EdPropInstanceButton: FC<{
const arg: any = { ...active.scope };
if (meta.item.script?.props) {
for (const [k, v] of Object.entries(meta.item.script?.props)) {
eval(`try { arg.${k} = ${v.value} } catch(e) {}`);
eval(`try { arg.${k} = ${v.value} } catch(e) { console.error("arg", e); }`);
}
} else if (meta.item.component) {
for (const [k, v] of Object.entries(meta.item.component.props)) {
eval(`try { arg.${k} = ${v.valueBuilt} } catch(e) {}`);
eval(`try { arg.${k} = ${v.valueBuilt} } catch(e) { console.error("arg", e); }`);
}
}

View File

@ -67,11 +67,11 @@ export const EdPropInstanceOptions: FC<{
if (meta.item.script?.props) {
for (const [k, v] of Object.entries(meta.item.script?.props)) {
eval(`try { arg.${k} = ${v.value} } catch(e) {}`);
eval(`try { arg.${k} = ${v.value} } catch(e) { console.error("arg", e); }`);
}
} else if (meta.item.component) {
for (const [k, v] of Object.entries(meta.item.component.props)) {
eval(`try { arg.${k} = ${v.valueBuilt} } catch(e) {}`);
eval(`try { arg.${k} = ${v.valueBuilt} } catch(e) { console.error("arg", e); }`);
}
}
eval(`

View File

@ -9,7 +9,6 @@ import { updatePropScope } from "./eval-prop";
import { extractNavigate } from "./extract-nav";
import { createViLocal } from "./local";
import { createViPassProp } from "./passprop";
import get from "lodash.get";
export const viEvalScript = (
vi: {
page: VG["page"];