refactor: simplify render function

This commit is contained in:
Yue JIN
2025-05-20 18:18:44 +08:00
committed by GU Yiling
parent f81fd99c1a
commit 05bd137cce

View File

@ -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 || [])]
});
}
});