JSPM

  • Created
  • Published
  • Downloads 5988
  • Score
    100M100P100Q118670F
  • License MIT

Input field component to display currency value based on Vue.

Package Exports

  • vue-numeric

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vue-numeric) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

vue-numeric

npm version npm npm

Input field component to display currency value based on Vue.

Installation

$ npm install vue-numeric --save

Usage

screen shot 2016-12-08 at 2 19 31 pm

<template>
  <vue-numeric currency="$" separator="," v-model="price"></vue-numeric>
</template>

<script>
import VueNumeric from 'vue-numeric'

export default {

  name: 'App',

  components: {
    VueNumeric
  },

  data: () => ({
    price: ''
  }),
}
</script>

Props

  /**
   * Currency symbol.
   */
  currency: {
    default: '',
    required: false,
    type: String
  },

  /**
   * Default value.
   */
  default: {
    required: false,
    type: [Number, String]
  },

  /**
   * Maximum value allowed.
   */
  max: {
    required: false,
    type: [Number, String]
  },

  /**
   * Minimum value allowed.
   */
  min: {
    default: 0,
    required: false,
    type: [Number, String]
  },

  /**
   * Enable/Disable minus value.
   */
  minus: {
    default: true,
    required: false,
    type: Boolean
  },

  /**
   * Input placeholder.
   */
  placeholder: {
    required: false,
    type: String
  },

  /**
   * Number of decimals.
   * Decimals symbol are the opposite of separator symbol.
   */
  precision: {
    required: false,
    type: [Number, String]
  },

  /**
   * Thousand separator type.
   * Separator props accept either . or , (default).
   */
  separator: {
    default: ',',
    required: false,
    type: String
  }

License

Vue-Numeric is open-sourced software licensed under the MIT license