fix(core): node events 为空时,应为空数组

fix #500
This commit is contained in:
roymondchen 2023-04-10 16:50:13 +08:00
parent 84e2cdf22d
commit abcac71826

View File

@ -37,7 +37,7 @@ class Node extends EventEmitter {
public style?: {
[key: string]: any;
};
public events?: DeprecatedEventConfig[] | EventConfig[];
public events: DeprecatedEventConfig[] | EventConfig[];
public instance?: any;
public page?: Page;
public parent?: Node;
@ -52,7 +52,7 @@ class Node extends EventEmitter {
this.app = options.app;
const { events } = options.config;
this.data = options.config;
this.events = events;
this.events = events || [];
this.listenLifeSafe();
this.once('destroy', () => {