diff --git a/src/components/Graph.vue b/src/components/Graph.vue index ae62159a..bdc0dfb7 100644 --- a/src/components/Graph.vue +++ b/src/components/Graph.vue @@ -42,6 +42,9 @@ onMounted(async () => { setTimeout(() => { const instance = getInstance(); + if (!instance) { + return; + } instance.on("click", (params: any) => { emits("select", params); }); diff --git a/src/views/dashboard/controls/Widget.vue b/src/views/dashboard/controls/Widget.vue index 2460a435..6c93b39f 100644 --- a/src/views/dashboard/controls/Widget.vue +++ b/src/views/dashboard/controls/Widget.vue @@ -141,10 +141,10 @@ export default defineComponent({ watch( () => [props.data.metricTypes, props.data.metrics], () => { - if ( - dashboardStore.selectedGrid && - props.data.i !== dashboardStore.selectedGrid.i - ) { + if (!dashboardStore.selectedGrid) { + return; + } + if (props.data.i !== dashboardStore.selectedGrid.i) { return; } if (TableChartTypes.includes(dashboardStore.selectedGrid.graph.type)) { diff --git a/src/views/dashboard/panel/Layout.vue b/src/views/dashboard/panel/Layout.vue index 9b2f3100..dd88845c 100644 --- a/src/views/dashboard/panel/Layout.vue +++ b/src/views/dashboard/panel/Layout.vue @@ -39,7 +39,7 @@ limitations under the License. -->