fix instance
This commit is contained in:
parent
c3be80b2e9
commit
897b5fbe06
|
|
@ -89,7 +89,10 @@ export const EdSidePropInstance: FC<{ meta: IMeta }> = ({ meta }) => {
|
|||
for (const [k, v] of Object.entries(meta.item.script?.props)) {
|
||||
if (v.value && v.value.length > 3) {
|
||||
try {
|
||||
const evn = new Function("arg", `arg["${k}"] = ${v.value}`);
|
||||
const evn = new Function(
|
||||
"arg",
|
||||
`arg["${k}"] = (() => { ${v.value} })()`
|
||||
);
|
||||
evn(arg);
|
||||
} catch (e) {}
|
||||
}
|
||||
|
|
@ -100,7 +103,7 @@ export const EdSidePropInstance: FC<{ meta: IMeta }> = ({ meta }) => {
|
|||
try {
|
||||
const evn = new Function(
|
||||
"arg",
|
||||
`arg["${k}"] = ${v.valueBuilt}`
|
||||
`arg["${k}"] = (() => { ${v.valueBuilt} })()`
|
||||
);
|
||||
evn(arg);
|
||||
} catch (e) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,10 @@ export const EdPropInstanceButton: FC<{
|
|||
for (const [k, v] of Object.entries(meta.item.script?.props)) {
|
||||
if (v.value && v.value.length > 3) {
|
||||
try {
|
||||
const evn = new Function("arg", `arg["${k}"] = ${v.value}`);
|
||||
const evn = new Function(
|
||||
"arg",
|
||||
`arg["${k}"] = (() => { ${v.value} })()`
|
||||
);
|
||||
evn(arg);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
|
@ -46,7 +49,10 @@ export const EdPropInstanceButton: FC<{
|
|||
for (const [k, v] of Object.entries(meta.item.component.props)) {
|
||||
if (v.valueBuilt && v.valueBuilt.length > 3) {
|
||||
try {
|
||||
const evn = new Function("arg", `arg["${k}"] = ${v.valueBuilt}`);
|
||||
const evn = new Function(
|
||||
"arg",
|
||||
`arg["${k}"] = (() => { ${v.valueBuilt} })()`
|
||||
);
|
||||
evn(arg);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
|
|
|||
|
|
@ -83,7 +83,10 @@ export const EdPropInstanceOptions: FC<{
|
|||
for (const [k, v] of Object.entries(meta.item.script?.props)) {
|
||||
if (v.value && v.value.length > 3) {
|
||||
try {
|
||||
const evn = new Function("arg", `arg["${k}"] = ${v.value}`);
|
||||
const evn = new Function(
|
||||
"arg",
|
||||
`arg["${k}"] = (() => { ${v.value} })()`
|
||||
);
|
||||
evn(arg);
|
||||
} catch (e) {}
|
||||
}
|
||||
|
|
@ -95,7 +98,7 @@ export const EdPropInstanceOptions: FC<{
|
|||
try {
|
||||
const evn = new Function(
|
||||
"arg",
|
||||
`arg["${k}"] = ${v.valueBuilt}`
|
||||
`arg["${k}"] = (() => { ${v.valueBuilt} })()`
|
||||
);
|
||||
evn(arg);
|
||||
} catch (e) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue