mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
feat: core代码执行兼容老的数据格式
This commit is contained in:
parent
c2b000ac5f
commit
a03ac7c78b
@ -85,6 +85,11 @@ class Node extends EventEmitter {
|
||||
}
|
||||
|
||||
private async runCodeBlock(hook: string) {
|
||||
if (typeof this.data[hook] === 'function') {
|
||||
// 兼容旧的数据格式
|
||||
await this.data[hook](this);
|
||||
return;
|
||||
}
|
||||
if (this.data[hook]?.hookType !== HookType.CODE || !this.app.codeDsl || isEmpty(this.app?.codeDsl)) return;
|
||||
for (const item of this.data[hook].hookData) {
|
||||
const { codeId, params = {} } = item;
|
||||
|
Loading…
x
Reference in New Issue
Block a user