kevinongko/vue-numeric
소개
Vue.js를 기반으로 서식이 지정된 통화 값을 표시하는 입력 필드 컴포넌트
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- -1
- in 15 days
- -1
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalvue-numeric
Input field component to display a formatted currency value based on Vue.
Works with Vue 2.*
Installation
Install via CDN
<script src="https://unpkg.com/accounting-js"></script>
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/vue-numeric"></script>
<script>
Vue.use(VueNumeric.default)
</script>
Install via NPM
$ npm install vue-numeric --save
Register as Component
import Vue from 'vue'
import VueNumeric from 'vue-numeric'
export default {
name: 'App',
components: {
VueNumeric
}
}
Register as Plugin
import Vue from 'vue'
import VueNumeric from 'vue-numeric'
Vue.use(VueNumeric)
Usage

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 symbol
Set the currency prop to add a currency symbol within the input.
<vue-numeric currency="$"></vue-numeric>
Minimum & maximum constraint
Limit the minimum and maximum value by using min and max props.
mindefaults to0.minandmaxacceptStringorNumbervalues.
<vue-numeric v-bind:min="2000" v-bind:max="10000"></vue-numeric>
Disable/enable negative values
minus defaults to false (no negative numbers).
<vue-numeric v-bind:minus="false"></vue-numeric>
Enable decimal precision
By default the decimal value is disabled. To use decimals in the value, add the precision prop.
precisionaccept aStringorNumbernumeric value.
<vue-numeric v-bind:precision="2"></vue-numeric>
Thousands separator
- Default thousand separator's symbol is
,. - Use the
separatorprop to change the thousands separator. separatoronly acceptsspace,,or..- When using the
.orspaceas thousand separator, the decimal separator will be,.
<vue-numeric separator="."></vue-numeric>
Input placeholder when empty
<vue-numeric placeholder="only number allowed"></vue-numeric>
Value when empty
By default, when you clean the input the value is set to 0. You can change this value to fit your needs.
<vue-numeric :empty-value="1"></vue-numeric>
Output Type
By default the value emitted for the input event is of type Number. However you may choose to get a String instead
by setting the property output-type to String.
<vue-numeric output-type="String"></vue-numeric>
Props
| Props | Description | Required | Type | Default |
|---|---|---|---|---|
| currency | Currency prefix | false | String | - |
| currency-symbol-position | Position of the symbol (accepted values: prefix or suffix) |
false | String | prefix |
| max | Maximum value allowed | false | Number | 9007199254740991 |
| min | Minimum value allowed | false | Number | -9007199254740991 |
| minus | Enable/disable negative values | false | Boolean | false |
| placeholder | Input placeholder | false | String | - |
| empty-value | Value when input is empty | false | Number | 0 |
| output-type | Output Type for input event | false | String | Number |
| precision | Number of decimals | false | Number | - |
| separator | Thousand separator symbol (accepts space, . or ,) |
false | String | , |
| decimal-separator | Custom decimal separator | false | String | - |
| thousand-separator | Custom thousand separator | false | String | - |
| read-only | Hide input field and show the value as text | false | Boolean | false |
| read-only-class | Class for read-only element | false | String | '' |
| allow-clear | Use input type search | false | Boolean | false |
License
Vue-Numeric is open-sourced software licensed under the MIT license
Support
Hello, I'm Kevin the maintainer of this project in my free time (which is getting lessen these days), if this project does help you in any way please consider to support me. Thanks :smiley:
관련 프로젝트 살펴보기
불러오는 중…