From 85d66d9cc6b3f9dfd275121071947fdc49b7a9aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=9C=8B?= Date: Fri, 12 Apr 2024 11:26:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0value=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/JiHeExpressway/components/Card1/index.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/Card1/index.vue b/ruoyi-ui/src/views/JiHeExpressway/components/Card1/index.vue index f218b3fc..7860b65d 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/Card1/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/Card1/index.vue @@ -11,7 +11,7 @@ {{ item.label }}: - {{ getValue(item.key) }}{{ item.suffix }} + {{ getValue(item) }}{{ item.suffix }}

@@ -106,8 +106,12 @@ export default { }; }, methods: { - getValue(key) { - return pathGet(this.cardData, key) ?? "-"; + getValue(item) { + let value = pathGet(this.cardData, item.key) ?? "-"; + if (item.value) { + value = item.value(this.cardData); + } + return value; }, onClick() {