mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-10-14 11:21:29 +00:00
fix: edit widget config
This commit is contained in:
@@ -28,6 +28,7 @@ import {
|
||||
import type { PropType } from "vue";
|
||||
import { useECharts } from "@/hooks/useEcharts";
|
||||
import { addResizeListener, removeResizeListener } from "@/utils/event";
|
||||
|
||||
/*global Nullable*/
|
||||
const chartRef = ref<Nullable<HTMLDivElement>>(null);
|
||||
const { setOptions, resize } = useECharts(chartRef as Ref<HTMLDivElement>);
|
||||
@@ -45,7 +46,7 @@ onMounted(() => {
|
||||
if (!chartRef.value) {
|
||||
return;
|
||||
}
|
||||
window.addEventListener("resize", resize);
|
||||
setOptions(props.option);
|
||||
addResizeListener(unref(chartRef), resize);
|
||||
});
|
||||
|
||||
@@ -60,7 +61,6 @@ onBeforeUnmount(() => {
|
||||
if (!chartRef.value) {
|
||||
return;
|
||||
}
|
||||
window.removeEventListener("resize", resize);
|
||||
removeResizeListener(unref(chartRef), resize);
|
||||
});
|
||||
</script>
|
||||
|
@@ -20,7 +20,6 @@ import Selector from "./Selector.vue";
|
||||
import Graph from "./Graph.vue";
|
||||
import type { App } from "vue";
|
||||
import VueGridLayout from "vue-grid-layout";
|
||||
import { ElLoading } from "element-plus";
|
||||
|
||||
const components: { [key: string]: any } = {
|
||||
Icon,
|
||||
@@ -28,7 +27,6 @@ const components: { [key: string]: any } = {
|
||||
VueGridLayout,
|
||||
Selector,
|
||||
Graph,
|
||||
ElLoading,
|
||||
};
|
||||
const componentsName: string[] = Object.keys(components);
|
||||
|
||||
|
Reference in New Issue
Block a user