Simple input mask lib for vue.js based on PureMask.js
This version requires Vue 2.X. If you are looking for Vue 1.X, check it here.
npm install v-mask
import Vue from 'vue'
import VueMask from 'v-mask'
/** Activate vue.js plugins **/
Vue.use(VueMask);
Now you are ready to use it in the code!
<input type="text" v-mask="'####-##'">
<!-- OR -->
<input type="text" v-mask="'##/##/#### ##:##'" >
List of supported placeholders:
Value | Format |
---|---|
# | Number (0-9) |
A | Letter in any case (a-z,A-Z) |
N | Number or letter |
X | Any symbol |
Jest is used for unit-tests
You can run tests by typing this command in your console:
npm test
PR is welcome!