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
Input field component to display currency value based on Vue.
Works with Vue 2.*
Installation
$ npm install vue-numeric --saveUsage

Quick example
<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>
Currency prefix
adding currency prefix to the input by using currency props.
<vue-numeric currency="$"></vue-numeric>Minimum & maximum constraint
Limit minimum and maximum input by using min, max props.
mindefault to0.min, maxacceptStringandNumber.
<vue-numeric min="2000" v-bind:max="10000"></vue-numeric>Disable/enable minus value
minusdefault totrue.
<vue-numeric v-bind:minus="false"></vue-numeric>Enable decimal value
By default the decimal value is disabled, to use decimal value add precision props.
precisionacceptStringandNumbernumeric value.
<vue-numeric v-bind:precision="2"></vue-numeric>Thousand separator
- Default thousand separator's symbol is
,. - Use
separatorprops to change separator's symbol. separatoronly accept either,or.value.- When using
.separator symbol, to input decimal value use,and vice versa.
<vue-numeric separator="."></vue-numeric>Input placeholder when empty
<vue-numeric placeholder="only number allowed"></vue-numeric>Props
| Props | Description | Required | Type | Default |
|---|---|---|---|---|
| currency | Currency prefix | false | String | - |
| default | Input default value | false | Number, String | - |
| max | Maximum value allowed | false | Number, String | - |
| min | Minimum value allowed | false | Number, String | 0 |
| minus | Enable/disable minus value | false | Boolean | true |
| placeholder | Input placeholder | false | String | - |
| precision | Number of decimals | false | Number, String | - |
| separator | Thousand separator type ( accept either . or , ) |
false | String | , |
License
Vue-Numeric is open-sourced software licensed under the MIT license