vue-inputmask-ng
v0.0.20
Published
Vue.js plugin which is based on the InputMask
Downloads
14
Maintainers
Readme
vue-inputmask-ng
Vue.js plugin which is based on the InputMask
Include vue-inputmask-ng after Vue and it will install itself automatically:
<script src="/path/to/vue.js"></script>
<script src="/path/to/vue-inputmask-ng.umd.js"></script>
When used with a module system, you must install it via Vue.use():
npm install vue-inputmask-ng
import VueInputMask from 'vue-inputmask-ng'
Vue.use(VueInputMask)
Usage as directive
<input type="tel" v-mask="'[+9] (999) 999 99 99'"/>
<input type="tel" v-mask="{ mask: '99/99/9999', greedy: true }"/>
<input type="tel" v-mask="{ mask: () => ['999', '(9{4,})'] }">
Usage as component
<input-mask type="tel" mask="[+9] (999) 999 99 99" @complete="..." @incomplete="..." @cleared="..." />
<element-mask tag="h1" contenteditable="true" mask="[+9] (999) 999 99 99"/>
Vue instance methods
this.$inputMaskFormat('2331973', { alias: 'datetime', inputFormat: 'dd/mm/yyyy' })
this.$inputMaskIsValid('23/03/1973', { alias: 'datetime', inputFormat: 'dd/mm/yyyy' })
Development
npm install
npm run build