feat(core): hook函数调用添加node参数

This commit is contained in:
roymondchen 2025-03-04 19:11:36 +08:00
parent a4d021d2fb
commit 5ba2a73c70

View File

@ -102,8 +102,9 @@ class Node extends EventEmitter {
const { codeType = HookCodeType.CODE, codeId, params: itemParams = {} } = item; const { codeType = HookCodeType.CODE, codeId, params: itemParams = {} } = item;
let functionContent: ((...args: any[]) => any) | string | undefined; let functionContent: ((...args: any[]) => any) | string | undefined;
const functionParams: { app: TMagicApp; params: Record<string, any>; dataSource?: DataSource } = { const functionParams: { app: TMagicApp; node: Node; params: Record<string, any>; dataSource?: DataSource } = {
app: this.app, app: this.app,
node: this,
params: params || itemParams, params: params || itemParams,
}; };