feat: Implement templates for dashboards (#28)

This commit is contained in:
Fine0830
2022-03-19 12:11:35 +08:00
committed by GitHub
parent 1cf3887675
commit 597e98e291
61 changed files with 1583 additions and 1193 deletions

View File

@@ -20,7 +20,6 @@ import { watch, ref, Ref, onMounted, onBeforeUnmount, unref } from "vue";
import type { PropType } from "vue";
import { useECharts } from "@/hooks/useEcharts";
import { addResizeListener, removeResizeListener } from "@/utils/event";
import { useTimeoutFn } from "@/hooks/useTimeout";
/*global Nullable, defineProps, defineEmits*/
const emits = defineEmits(["select"]);
@@ -40,9 +39,12 @@ const props = defineProps({
onMounted(async () => {
await setOptions(props.option);
addResizeListener(unref(chartRef), resize);
useTimeoutFn(() => {
setTimeout(() => {
const instance = getInstance();
if (!instance) {
return;
}
instance.on("click", (params: any) => {
emits("select", params);
});