Skip to content

Commit ea4325e

Browse files
committed
refactor: rename realListeners to listeners
1 parent 667ef7b commit ea4325e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/ECharts.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,10 @@ export default defineComponent({
9393
const nonEventAttrs = computed(() => omitOn(attrs));
9494
const nativeListeners: Record<string, unknown> = {};
9595

96-
const realListeners: Record<string, any> = {};
96+
const listeners: Record<string, any> = {};
9797

98-
// We are converting all `on<Event>` props to event listeners compatible with Vue 2
99-
// and collect them into `realListeners` so that we can bind them to the chart instance
100-
// later in the same way.
98+
// We are converting all `on<Event>` props and collect them into `listeners` so that
99+
// we can bind them to the chart instance later.
101100
// For `onNative:<event>` props, we just strip the `Native:` part and collect them into
102101
// `nativeListeners` so that we can bind them to the root element directly.
103102
Object.keys(attrs)
@@ -124,7 +123,7 @@ export default defineComponent({
124123
event = `~${event.substring(0, event.length - 4)}`;
125124
}
126125

127-
realListeners[event] = attrs[key];
126+
listeners[event] = attrs[key];
128127
});
129128

130129
function init(option?: Option) {
@@ -142,8 +141,8 @@ export default defineComponent({
142141
instance.group = props.group;
143142
}
144143

145-
Object.keys(realListeners).forEach(key => {
146-
let handler = realListeners[key];
144+
Object.keys(listeners).forEach(key => {
145+
let handler = listeners[key];
147146

148147
if (!handler) {
149148
return;

0 commit comments

Comments
 (0)