From 139c5ac8f5f6740f6a156196c376394e24cfa841 Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Thu, 14 Apr 2022 18:04:42 +0800 Subject: [PATCH] fix unit --- src/views/dashboard/graphs/Card.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/views/dashboard/graphs/Card.vue b/src/views/dashboard/graphs/Card.vue index 234f8b9a..cfe37f65 100644 --- a/src/views/dashboard/graphs/Card.vue +++ b/src/views/dashboard/graphs/Card.vue @@ -23,7 +23,7 @@ limitations under the License. --> }" > {{ singleVal.toFixed(2) }} - + {{ decodeURIComponent(unit) }} @@ -55,7 +55,9 @@ const metricConfig = computed(() => props.config.metricConfig || []); const key = computed(() => Object.keys(props.data)[0]); const singleVal = computed(() => Number(props.data[key.value])); const unit = computed( - () => metricConfig.value[0] && encodeURIComponent(metricConfig.value[0].unit) + () => + metricConfig.value[0] && + encodeURIComponent(metricConfig.value[0].unit || "") );