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() { render() {
const attrs = { ...this.nonEventAttrs, ...this.nativeListeners }; return h(TAG_NAME, {
attrs.ref = "root"; ...this.nonEventAttrs,
attrs.class = attrs.class ? ["echarts"].concat(attrs.class) : "echarts"; ...this.nativeListeners,
return h(TAG_NAME, attrs); ref: "root",
class: ["echarts", ...(this.nonEventAttrs.class || [])]
});
} }
}); });