code refactor

This commit is contained in:
MaysWind
2023-07-16 22:55:02 +08:00
parent 41034de676
commit ed4040f2ec
5 changed files with 25 additions and 8 deletions
+4 -1
View File
@@ -16,7 +16,7 @@
>
<template #title>
<div class="no-padding no-margin">
<span>{{ $t(`currency.${baseCurrency}`) }}&nbsp;</span>
<span>{{ getCurrencyName(baseCurrency) }}&nbsp;</span>
<small class="smaller">{{ baseCurrency }}</small>
</div>
</template>
@@ -207,6 +207,9 @@ export default {
}
});
},
getCurrencyName(currencyCode) {
return this.$locale.getCurrencyName(currencyCode);
},
getConvertedAmount(toExchangeRate) {
const fromExchangeRate = this.exchangeRatesStore.latestExchangeRateMap[this.baseCurrency];
return getConvertedAmount(this.baseAmount / 100, fromExchangeRate, toExchangeRate);