Skip to content
Snippets Groups Projects
CurrencyInput.vue 641 B
<template>
  <input
    ref="inputRef"
    type="text"
    required
    class="form-control text-end"
    min="0"
    :value="formattedValue"
  />
</template>

<script>
import useCurrencyInput from "vue-currency-input";
import "bootstrap";
import "bootstrap/dist/css/bootstrap.css";
export default {
  name: "CurrencyInput",
  props: {
    modelValue: { type: Number, default: 0 },
    required: Boolean,
    options: Object,
  },
  setup() {
    const { formattedValue, inputRef } = useCurrencyInput({
      currency: "EUR",
      distractionFree: false,
    });

    return { inputRef, formattedValue };
  },
};
</script>

<style></style>