fix
This commit is contained in:
parent
162bb69908
commit
03b97dac9a
File diff suppressed because one or more lines are too long
|
|
@ -152,17 +152,24 @@ export const viEvalProps = (
|
||||||
let val = fn(...Object.values(arg));
|
let val = fn(...Object.values(arg));
|
||||||
|
|
||||||
if (typeof val === "function") {
|
if (typeof val === "function") {
|
||||||
val = (...args: any[]) => {
|
if (w.isEditor) {
|
||||||
const definer = new Function(
|
script.props[name].fn = val;
|
||||||
...Object.keys(arg),
|
val = (...args: any[]) => {
|
||||||
`// [${meta.item.name}] ${name}: ${meta.item.id}
|
if (script) return script.props?.[name].fn(...args);
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
val = (...args: any[]) => {
|
||||||
|
const definer = new Function(
|
||||||
|
...Object.keys(arg),
|
||||||
|
`// [${meta.item.name}] ${name}: ${meta.item.id}
|
||||||
return ${src}
|
return ${src}
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
|
|
||||||
const fn = definer(...Object.values(arg));
|
const fn = definer(...Object.values(arg));
|
||||||
return fn(...args);
|
return fn(...args);
|
||||||
};
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
arg[name] = val;
|
arg[name] = val;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue