1.0.8-rc.2 • Published 4 years ago

@incluirtec/v-currency-field v1.0.8-rc.2

Weekly downloads
98
License
MIT
Repository
github
Last release
4 years ago

Currency Mask for Vuetify

Features

  • All features from v-money as v-text-field of vuetify.

Usage

Globally

import Vue from 'vue'
import currency from 'v-currency-field'

import 'v-currency-field/dist/index.css'

Vue.use(currency)

Example

<template>
  <div>
    <v-currency-field label="Value" v-bind="currency_config" :error-messages="errors.price" v-model="price"></v-currency-field>
  </div>
</template>

<script>
  export default {
    data () {
      return {
        errors: {},
        price: 123.45,
        currency_config: {
          decimal: ',',
          thousands: '.',
          prefix: 'R$ ',
          suffix: ' #',
          precision: 2,
          masked: false,
          allowBlank: false,
          min: Number.MIN_SAFE_INTEGER,
          max: Number.MAX_SAFE_INTEGER
        }
      }
    }
  }
</script>

Properties

All v-money properties

propertyRequiredTypeDefaultDescription
precisiontrueNumber2How many decimal places
decimalfalseString"."Decimal separator
thousandsfalseString","Thousands separator
prefixfalseString""Currency symbol followed by a Space, like "R$ "
suffixfalseString""Percentage for example: " %"
maskedfalseBooleanfalseIf the component output should include the mask or not
allowBlankfalseBooleanfalseIf the field can start blank and be cleared out by user
minfalseNumberNumber.MIN_SAFE_INTEGERThe min value allowed
maxfalseNumberNumber.MAX_SAFE_INTEGERThe max value allowed

And all vuetify properties

propertyRequiredTypeObservation
appendOuterIconfalseString
appendOuterIconCbfalseFunctionWorking but deprecated
@click:append-outerfalseFunctionNot Working
autofocusfalseBoolean
boxfalseBoolean
browserAutocompletefalseStringNot Tested
clearablefalseBooleanNot Working Event
clearIconfalseString
clearIconCbfalseNumberWorking but deprecated
@click:clearfalseNumberNot Working
colorfalseString
flatfalseBoolean
fullWidthfalseBoolean
labelfalseString
outlinefalseBoolean
prependInnerIconfalseString
prependInnerIconCbfalseFunctionWorking but deprecated
@click:prepend-innerfalseFunctionNot Working
reversefalseBoolean
singleLinefalseBoolean
solofalseBoolean
soloInvertedfalseBoolean
error-messagesfalse[]
disabledfalseBoolean
readonlyfalseBoolean
darkfalseBoolean
heightfalseString
hintfalseString
lightfalseBoolean
background-colorfalseString

References