use autocomplete to replace select

This commit is contained in:
MaysWind
2023-06-24 01:22:35 +08:00
parent 838b56089b
commit edfcd0dc6e
+10 -2
View File
@@ -30,7 +30,7 @@
<span class="text-subtitle-1">{{ $t('Base Currency') }}</span> <span class="text-subtitle-1">{{ $t('Base Currency') }}</span>
</v-col> </v-col>
<v-col cols="12" md="10" class="mb-6"> <v-col cols="12" md="10" class="mb-6">
<v-select <v-autocomplete
density="compact" density="compact"
single-line single-line
item-title="currencyDisplayName" item-title="currencyDisplayName"
@@ -38,7 +38,11 @@
:disabled="loading" :disabled="loading"
:items="availableExchangeRates" :items="availableExchangeRates"
v-model="baseCurrency" v-model="baseCurrency"
></v-select> >
<template v-slot:no-data>
<div class="px-4">{{ $t('No results') }}</div>
</template>
</v-autocomplete>
</v-col> </v-col>
</v-row> </v-row>
<v-row no-gutters> <v-row no-gutters>
@@ -179,6 +183,10 @@ export default {
}); });
}, },
getConvertedAmount(toExchangeRate) { getConvertedAmount(toExchangeRate) {
if (!this.baseCurrency) {
return 0;
}
const fromExchangeRate = this.exchangeRatesStore.latestExchangeRateMap[this.baseCurrency]; const fromExchangeRate = this.exchangeRatesStore.latestExchangeRateMap[this.baseCurrency];
if (!fromExchangeRate) { if (!fromExchangeRate) {