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;