From 05bd137cce3bc08d958f4746d75fbb99fc1c5968 Mon Sep 17 00:00:00 2001 From: Yue JIN Date: Tue, 20 May 2025 18:18:44 +0800 Subject: [PATCH] refactor: simplify render function --- src/ECharts.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ECharts.ts b/src/ECharts.ts index 9721246..6ec6791 100644 --- a/src/ECharts.ts +++ b/src/ECharts.ts @@ -307,9 +307,11 @@ export default defineComponent({ }; }, render() { - const attrs = { ...this.nonEventAttrs, ...this.nativeListeners }; - attrs.ref = "root"; - attrs.class = attrs.class ? ["echarts"].concat(attrs.class) : "echarts"; - return h(TAG_NAME, attrs); + return h(TAG_NAME, { + ...this.nonEventAttrs, + ...this.nativeListeners, + ref: "root", + class: ["echarts", ...(this.nonEventAttrs.class || [])] + }); } });