Skip to content

Commit 44a4a6c

Browse files
committed
refactor: simplify render function
1 parent d1ea0fb commit 44a4a6c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/ECharts.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,11 @@ export default defineComponent({
307307
};
308308
},
309309
render() {
310-
const attrs = { ...this.nonEventAttrs, ...this.nativeListeners };
311-
attrs.ref = "root";
312-
attrs.class = attrs.class ? ["echarts"].concat(attrs.class) : "echarts";
313-
return h(TAG_NAME, attrs);
310+
return h(TAG_NAME, {
311+
...this.nonEventAttrs,
312+
...this.nativeListeners,
313+
ref: "root",
314+
class: ["echarts", ...(this.nonEventAttrs.class || [])]
315+
});
314316
}
315317
});

0 commit comments

Comments
 (0)