vue-input-currency

1.0.4 • Public • Published

Currency Input for Vue3

version version license

This package provides a HTML input that formats your number input to any currency using the Intl.NumberFormat.

Installation

You can install the package via composer:

npm i vue-input-currency

Simple Usage

  1. Import in your component and assign a type number value ref of to a value property.
  2. The input handles all user inputs and emit the updates on the @update:values
<script setup>
  function handleValue({ float, masked }) {
    console.log(float, masked)
  }
</script>

<template>
  <CurrencyInput
    @update:values="handleValue"
    :value="value"
  />
</template>

Properties

You can use the following properties:

Property Required Default OBS
locale No pt-BR Intl.NumberFormat locales
currency No BRL Intl.NumberFormat currency
value No 0 Inital value

This package is open-sourced and licensed under the MIT license.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i vue-input-currency

      Weekly Downloads

      12

      Version

      1.0.4

      License

      MIT

      Unpacked Size

      1.12 MB

      Total Files

      8

      Last publish

      Collaborators

      • jhonathannc