For currency display, it uses the vue-currency-input component to display the current value according to the current currency.
<template>
<v-row no-gutters>
<v-col lg="3" md="4" sm="6">
<va-select-input :label="$t('demo.currencyId')" reference="currencies" v-model="model.currencyId">
</va-select-input>
<va-currency-input clearable :label="$t('demo.amount')" v-model="model.amount" :key="'amount_' + getCurrencyId" :options="{ currency: getCurrencyId, precision: 2 }"></va-currency-input>
</v-col>
</v-row>
</template>
<script>
export default {
data() {
return {
model: {
amount: 0,
currencyId: { id: "USD", name: "Usd" },
},
};
},
computed: {
getCurrencyId() {
if (this.model && this.model.currencyId && this.model.currencyId.id) {
return this.model.currencyId.id;
}
return "TRY";
},
}
};
</script>
Property | Type | Description |
---|---|---|
source | string |
The property of the resource to fetch the value to display. Supports dot display for slot used object. |
model | string |
By default source will be the last name sent to the API service for create/update. This support allows you to override this default behavior. |
variant | string |
Applies different styles to the component. (outlined, plain, underlined, solo, filled, solo-filled, solo-inverted). |
options | object |
Allows you to enter vue-currency-input options. Example: options="{ currency: "USD", precision: 2 } |