Skip to content

Commit 6e316c8

Browse files
authored
Update README.md
1 parent 12d7878 commit 6e316c8

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
Input field component to display currency value based on [Vue](https://vuejs.org/).
88

9+
``Works with Vue 2.*``
10+
911
## Installation
1012

1113
```sh
@@ -17,6 +19,7 @@ $ npm install vue-numeric --save
1719

1820
![screen shot 2016-12-08 at 2 19 31 pm](https://cloud.githubusercontent.com/assets/15880638/21001265/f2322438-bd51-11e6-8985-f31a45702484.png)
1921

22+
### Quick example
2023

2124
```vue
2225
<template>
@@ -42,6 +45,55 @@ export default {
4245
4346
```
4447

48+
### Currency prefix
49+
50+
adding currency prefix to the input by using `currency` props.
51+
52+
```vue
53+
<vue-numeric currency="$"></vue-numeric>
54+
```
55+
56+
### Minimum & maximum constraint
57+
58+
Limit minimum and maximum input by using `min, max` props.
59+
60+
- `min` default to `0`.
61+
- `min, max` accept `String` and `Number`.
62+
63+
```vue
64+
<vue-numeric min="2000" v-bind:max="10000"></vue-numeric>
65+
```
66+
67+
### Disable/enable minus value
68+
- `minus` default to `true`.
69+
70+
```vue
71+
<vue-numeric v-bind:minus="false"></vue-numeric>
72+
```
73+
74+
### Enable decimal value
75+
By default the decimal value is disabled, to use decimal value add `precision` props.
76+
- `precision` accept `String` and `Number` numeric value.
77+
78+
```vue
79+
<vue-numeric v-bind:precision="2"></vue-numeric>
80+
```
81+
82+
### Thousand separator
83+
- Default thousand separator's symbol is `,`.
84+
- Use `separator` props to change separator's symbol.
85+
- `separator` only accept either `,` or `.` value.
86+
- When using `.` separator symbol, to input decimal value use `,` and vice versa.
87+
88+
```vue
89+
<vue-numeric separator="."></vue-numeric>
90+
```
91+
92+
### Input placeholder when empty
93+
```vue
94+
<vue-numeric placeholder="only number allowed"></vue-numeric>
95+
```
96+
4597
## Props
4698
```js
4799
/**

0 commit comments

Comments
 (0)