From df359ca684f6a6a4decee9262d4ce0534a03f8b9 Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Wed, 10 May 2023 16:19:22 +0800 Subject: [PATCH] add price load --- src/modules/[chain]/index.vue | 21 ++++++++++++++++++--- src/pages/index.vue | 2 +- src/stores/useDashboard.ts | 26 ++++++++++++++++++++++++++ src/stores/useFormatter.ts | 33 ++++++++++++++++++++++++++++++++- 4 files changed, 77 insertions(+), 5 deletions(-) diff --git a/src/modules/[chain]/index.vue b/src/modules/[chain]/index.vue index 521dd631..f3afbd37 100644 --- a/src/modules/[chain]/index.vue +++ b/src/modules/[chain]/index.vue @@ -67,7 +67,20 @@ const comLinks = [ ]; // wallet box - +const change = computed(() => { + const token = walletStore.balanceOfStakingToken + return token? format.priceChanges(token.denom) : 0 +}) +const color= computed(() => { + switch(true) { + case change.value > 0: + return "text-green-600" + case change.value === 0: + return "text-grey-500" + case change.value < 0: + return "text-red-600" + } +})