From 0aec2ecbd6c6983c3d0369c1838ea23b4d26e523 Mon Sep 17 00:00:00 2001 From: Yue JIN Date: Tue, 20 May 2025 18:40:48 +0800 Subject: [PATCH] refactor: rename realListeners to listeners --- src/ECharts.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/ECharts.ts b/src/ECharts.ts index 6ec6791..31f3eea 100644 --- a/src/ECharts.ts +++ b/src/ECharts.ts @@ -93,11 +93,10 @@ export default defineComponent({ const nonEventAttrs = computed(() => omitOn(attrs)); const nativeListeners: Record = {}; - const realListeners: Record = {}; + const listeners: Record = {}; - // We are converting all `on` props to event listeners compatible with Vue 2 - // and collect them into `realListeners` so that we can bind them to the chart instance - // later in the same way. + // We are converting all `on` props and collect them into `listeners` so that + // we can bind them to the chart instance later. // For `onNative:` props, we just strip the `Native:` part and collect them into // `nativeListeners` so that we can bind them to the root element directly. Object.keys(attrs) @@ -124,7 +123,7 @@ export default defineComponent({ event = `~${event.substring(0, event.length - 4)}`; } - realListeners[event] = attrs[key]; + listeners[event] = attrs[key]; }); function init(option?: Option) { @@ -142,8 +141,8 @@ export default defineComponent({ instance.group = props.group; } - Object.keys(realListeners).forEach(key => { - let handler = realListeners[key]; + Object.keys(listeners).forEach(key => { + let handler = listeners[key]; if (!handler) { return;