feat: use custom element, update vue-demi

This commit is contained in:
Justineo
2021-02-28 02:49:19 +08:00
parent 121570378f
commit c400baf8d8
7 changed files with 535 additions and 515 deletions

View File

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