Skip to content

Commit

Permalink
Create README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
biennui1998mu authored Jun 22, 2022
1 parent 08ad9f4 commit 5abd390
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
### Package install

```
npm install vuenos-input-money
```

### Import component

```html

<VuenosInputMoney ref="InputMoneyRef"
@getValue="getMoneyVal"
@blur="blurInput"
:placeholder="'Số tiền'"
:suffix="'VNĐ'"
:maxLength="14"
:disabled="true"
:error="true"
:showText="true">
</VuenosInputMoney>
```

```typescript
import VuenosInputMoney from "vuenos-input-money";
```

### Get value input

```typescript
const getMoneyVal = (val) => {
console.log(val);
}
```

### Set value input

```typescript
const InputMoneyRef = ref<null | { setInput: (val) => null }>(null)
const setInputMoneyVal = (val) => {
InputMoneyRef.value?.setInput(val)
}
return {
InputMoneyRef
}
```

### Trigger blur action

```typescript
const blurInput = async () => {
//do something
}
```

### Variables binding

| ATTRIBUTE | DESCRIPTION | REQUIRED | TYPE | ACCEPTED VALUES | DEFAULT |
|:------------|:----------------------------|:--------:|:-------:|----------------:|--------:|
| placeholder | placeholder of input | | String | 'Số tiền' | empty |
| suffix | suffix of input | | String | 'VNĐ' | empty |
| maxLength | maxlength of input | | Number | 14 | empty |
| showText | show convert number to text | | Boolean | true/false | false |
| disabled | disable input | | Boolean | true/false | false |
| error | error style input | | Boolean | true/false | empty |

0 comments on commit 5abd390

Please sign in to comment.