Skip to content

Commit 5abd390

Browse files
Create README.md
1 parent 08ad9f4 commit 5abd390

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
### Package install
2+
3+
```
4+
npm install vuenos-input-money
5+
```
6+
7+
### Import component
8+
9+
```html
10+
11+
<VuenosInputMoney ref="InputMoneyRef"
12+
@getValue="getMoneyVal"
13+
@blur="blurInput"
14+
:placeholder="'Số tiền'"
15+
:suffix="'VNĐ'"
16+
:maxLength="14"
17+
:disabled="true"
18+
:error="true"
19+
:showText="true">
20+
</VuenosInputMoney>
21+
```
22+
23+
```typescript
24+
import VuenosInputMoney from "vuenos-input-money";
25+
```
26+
27+
### Get value input
28+
29+
```typescript
30+
const getMoneyVal = (val) => {
31+
console.log(val);
32+
}
33+
```
34+
35+
### Set value input
36+
37+
```typescript
38+
const InputMoneyRef = ref<null | { setInput: (val) => null }>(null)
39+
const setInputMoneyVal = (val) => {
40+
InputMoneyRef.value?.setInput(val)
41+
}
42+
return {
43+
InputMoneyRef
44+
}
45+
```
46+
47+
### Trigger blur action
48+
49+
```typescript
50+
const blurInput = async () => {
51+
//do something
52+
}
53+
```
54+
55+
### Variables binding
56+
57+
| ATTRIBUTE | DESCRIPTION | REQUIRED | TYPE | ACCEPTED VALUES | DEFAULT |
58+
|:------------|:----------------------------|:--------:|:-------:|----------------:|--------:|
59+
| placeholder | placeholder of input | | String | 'Số tiền' | empty |
60+
| suffix | suffix of input | | String | 'VNĐ' | empty |
61+
| maxLength | maxlength of input | | Number | 14 | empty |
62+
| showText | show convert number to text | | Boolean | true/false | false |
63+
| disabled | disable input | | Boolean | true/false | false |
64+
| error | error style input | | Boolean | true/false | empty |

0 commit comments

Comments
 (0)