mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-10-30 16:38:16 +08:00
feat: use custom element, update vue-demi
This commit is contained in:
@ -13,7 +13,8 @@ import {
|
||||
onUnmounted,
|
||||
h,
|
||||
PropType,
|
||||
watchEffect
|
||||
watchEffect,
|
||||
Vue2
|
||||
} from "vue-demi";
|
||||
import { init as initChart } from "echarts/core";
|
||||
import {
|
||||
@ -35,6 +36,12 @@ import {
|
||||
} from "./composables";
|
||||
import "./style.css";
|
||||
|
||||
const TAG_NAME = "x-vue-echarts";
|
||||
|
||||
if (Vue2) {
|
||||
Vue2.config.ignoredElements.push(TAG_NAME);
|
||||
}
|
||||
|
||||
export const THEME_KEY = "ecTheme";
|
||||
export const INIT_OPTIONS_KEY = "ecInitOptions";
|
||||
export const UPDATE_OPTIONS_KEY = "ecUpdateOptions";
|
||||
@ -229,6 +236,6 @@ export default defineComponent({
|
||||
return exposed;
|
||||
},
|
||||
render() {
|
||||
return h("div", { class: "echarts", ref: "root" });
|
||||
return h(TAG_NAME, { class: "echarts", ref: "root" });
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user