mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-10-28 03:25:02 +08:00
fix: attributes should fall onto the root for Vue 2 (#670)
This commit is contained in:
@ -281,7 +281,11 @@ export default defineComponent({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
const attrs = { ...this.nonEventAttrs };
|
// Vue 3 and Vue 2 have different vnode props format:
|
||||||
|
// See https://v3-migration.vuejs.org/breaking-changes/render-function-api.html#vnode-props-format
|
||||||
|
const attrs = (
|
||||||
|
Vue2 ? { attrs: this.nonEventAttrs } : { ...this.nonEventAttrs }
|
||||||
|
) as any;
|
||||||
attrs.ref = "root";
|
attrs.ref = "root";
|
||||||
attrs.class = attrs.class ? ["echarts"].concat(attrs.class) : "echarts";
|
attrs.class = attrs.class ? ["echarts"].concat(attrs.class) : "echarts";
|
||||||
return h(TAG_NAME, attrs);
|
return h(TAG_NAME, attrs);
|
||||||
|
|||||||
Reference in New Issue
Block a user