-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08ad9f4
commit 5abd390
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |