vue-persian-numbers-directive
v1.0.2
Published
A Vue directive that converts Persian char numbers to English char numbers
Downloads
3
Maintainers
Readme
vue-persian-numbers-directive
A Vue directive that converts Persian char numbers to English char numbers
Install the dependency
yarn add vue-persian-numbers-directive
# or
npm i vue-persian-numbers-directive
How to use
import { toEnglishNumbersDirective, toOnlyEnglishNumbersDirective } from 'vue-persian-numbers-directive/src/vue-persian-numbers-directive'
Convert Persian numbers to English numbers and allow other characters:
app.directive('englishNumbers', toEnglishNumbersDirective)
Then use the directive as v-english-numbers on input component like this:
<any-input
v-english-numbers
v-model="theModel"
anything else...>
</any-input>
Convert Persian numbers to English numbers and not allow any other character:
app.directive('onlyEnglishNumbers', toOnlyEnglishNumbersDirective)
Then use the directive as v-only-english-numbers on input component like this:
<any-input
v-only-english-numbers
v-model="theModel"
anything else...>
</any-input>