mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-06-19 04:01:33 +08:00
chore(core): ts报错修改
This commit is contained in:
parent
551da1a64b
commit
040d679b7f
@ -44,7 +44,7 @@ interface EventCache {
|
||||
|
||||
class App extends EventEmitter {
|
||||
public env;
|
||||
public codeDsl: CodeBlockDSL;
|
||||
public codeDsl: CodeBlockDSL | undefined;
|
||||
public pages = new Map<Id, Page>();
|
||||
|
||||
public page: Page | undefined;
|
||||
|
@ -85,9 +85,9 @@ class Node extends EventEmitter {
|
||||
}
|
||||
|
||||
private async runCodeBlock(hook: string) {
|
||||
if (!Array.isArray(this.data[hook]) || isEmpty(this.app?.codeDsl)) return;
|
||||
if (!Array.isArray(this.data[hook]) || !this.app.codeDsl || isEmpty(this.app?.codeDsl)) return;
|
||||
for (const codeId of this.data[hook]) {
|
||||
if (this.app?.codeDsl[codeId] && typeof this.app?.codeDsl[codeId]?.content === 'function') {
|
||||
if (this.app.codeDsl[codeId] && typeof this.app?.codeDsl[codeId]?.content === 'function') {
|
||||
await this.app.codeDsl[codeId].content(this);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user