From bf9509e27123ffccc0c77fb785197f811bccd33b Mon Sep 17 00:00:00 2001 From: skie1997 Date: Thu, 26 Oct 2023 14:44:03 +0800 Subject: [PATCH] fix: event on error after release --- packages/vchart/src/core/vchart.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vchart/src/core/vchart.ts b/packages/vchart/src/core/vchart.ts index 7ab9ade6ce..e1220f0b73 100644 --- a/packages/vchart/src/core/vchart.ts +++ b/packages/vchart/src/core/vchart.ts @@ -989,8 +989,8 @@ export class VChart implements IVChart { on(eType: EventType, handler: EventCallback): void; on(eType: EventType, query: EventQuery, handler: EventCallback): void; on(eType: EventType, query: EventQuery | EventCallback, handler?: EventCallback): void { - if (!this._userEvents || this._userEvents.length === 0) { - return; + if (!this._userEvents) { + this._userEvents = []; } this._userEvents.push({ eType,