This commit is contained in:
Rizky 2024-07-18 10:47:43 +07:00
parent 162bb69908
commit 03b97dac9a
2 changed files with 29 additions and 22 deletions

File diff suppressed because one or more lines are too long

View File

@ -152,6 +152,12 @@ export const viEvalProps = (
let val = fn(...Object.values(arg)); let val = fn(...Object.values(arg));
if (typeof val === "function") { if (typeof val === "function") {
if (w.isEditor) {
script.props[name].fn = val;
val = (...args: any[]) => {
if (script) return script.props?.[name].fn(...args);
};
} else {
val = (...args: any[]) => { val = (...args: any[]) => {
const definer = new Function( const definer = new Function(
...Object.keys(arg), ...Object.keys(arg),
@ -164,6 +170,7 @@ export const viEvalProps = (
return fn(...args); return fn(...args);
}; };
} }
}
arg[name] = val; arg[name] = val;
_props[name] = val; _props[name] = val;