Vue wrapper over autonumeric library
npm install autonumeric-vuesh
yarn add autonumeric-vue
or
npm install autonumeric-vue --save
`
You will as usual be able to use the autonumeric-vue component in your Vue components using:
`js
import AutoNumericVue from 'autonumeric-vue/src/components/AutoNumericVue';
export default {
components: {
AutoNumericVue
}
}
`
$3
The AutoNumeric component can be instantiated the same way AutoNumeric can.
With an option object:
`html
v-model="myValue"
:options="{
digitGroupSeparator: '.',
decimalCharacter: ',',
decimalCharacterAlternative: '.',
currencySymbol: '\u00a0€',
currencySymbolPlacement: 's',
roundingMethod: 'U',
minimumValue: '0'
}"
>
`
With a predefined option name:
`html
v-model="myValue"
:options="'French'"
>
`
With multiple option objects/predefined options:
`html
v-model="myValue"
:options="['euro', { minimumValue: '0' }]"
>
`
#### Other props
##### Placeholder
You can define the input placeholder using:
`html
v-model="myValue"
:options="'euro'"
:placeholder="'Enter your value here'"
>
`
$3
Please note that directly setting a :value='42' on the component will break it (really!).
Do NOT do that:
`html
v-model="myValue"
:options="{ minimumValue: '0' }"
:value="42042.69"
>
$3
The official AutoNumeric documentation is using this component extensively :)
$3
- AutoNumeric ^v4
- Vue.js ^v2
$3
This supports the same browsers than AutoNumeric supports:
- Firefox and
- Chrome
(latest 2 versions)
If you use IE/Edge/Safari/Opera, this might work ;)
The contribution guidelines for vue-autoNumeric are the same than for the parent AutoNumeric project.
$3
As always, if you find this useful, please consider supporting its development!
Huge Thanks :)
$3
autonumeric-vue` is open-source and released under the MIT License.