diff --git a/app/web/src/nova/ed/panel/side/prop-instance.tsx b/app/web/src/nova/ed/panel/side/prop-instance.tsx index 092d7ada..e8f8d56c 100644 --- a/app/web/src/nova/ed/panel/side/prop-instance.tsx +++ b/app/web/src/nova/ed/panel/side/prop-instance.tsx @@ -83,15 +83,19 @@ 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) { console.error("arg", e); }` - ); + if (v.value) { + 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) { console.error("arg", e); }` - ); + if (v.valueBuilt) { + eval( + `try { arg.${k} = ${v.valueBuilt} } catch(e) { console.error("arg", e); }` + ); + } } } diff --git a/app/web/src/nova/ed/panel/side/prop-instance/prop-button.tsx b/app/web/src/nova/ed/panel/side/prop-instance/prop-button.tsx index 62bf9fd2..a6b828e1 100644 --- a/app/web/src/nova/ed/panel/side/prop-instance/prop-button.tsx +++ b/app/web/src/nova/ed/panel/side/prop-instance/prop-button.tsx @@ -31,11 +31,19 @@ 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) { console.error("arg", e); }`); + if (v.value) { + 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) { console.error("arg", e); }`); + if (v.valueBuilt) { + eval( + `try { arg.${k} = ${v.valueBuilt} } catch(e) { console.error("arg", e); }` + ); + } } } diff --git a/app/web/src/nova/ed/panel/side/prop-instance/prop-option.tsx b/app/web/src/nova/ed/panel/side/prop-instance/prop-option.tsx index 9de852e4..ce56885b 100644 --- a/app/web/src/nova/ed/panel/side/prop-instance/prop-option.tsx +++ b/app/web/src/nova/ed/panel/side/prop-instance/prop-option.tsx @@ -67,16 +67,20 @@ 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) { console.error("arg", e); }` - ); + if (v.value) { + eval( + `try { arg.${k} = ${v.value} } catch(e) { console.error("arg", e); }` + ); + } } } if (meta.item.component) { for (const [k, v] of Object.entries(meta.item.component.props)) { - eval( - `try { arg.${k} = ${v.valueBuilt} } catch(e) { console.error("arg", e); }` - ); + if (v.valueBuilt) { + eval( + `try { arg.${k} = ${v.valueBuilt} } catch(e) { console.error("arg", e); }` + ); + } if (v.content) { eval(