vue-inputmask-fork-for-nested-inputs
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

vue-inputmask

Vue.js directive to add a mask to your inputs (vanilla javascript).

It's a binding for the inputmask library by Robin Herbots https://github.com/RobinHerbots/Inputmask

Vue-inputmask demo

This library is licensed under MIT License.

Install

npm install -S vue-inputmask

Setup

With Typescript

import Vue from 'vue'
const VueInputMask = require('vue-inputmask').default

Vue.use(VueInputMask)

With a script tag

<script src="./node_modules/inputmask/dist/inputmask/dependencyLibs/inputmask.dependencyLib.js"></script>
<script src="./node_modules/inputmask/dist/inputmask/inputmask.js"></script>
<script src="./dist/vue-inputmask-browser.js"></script>

Usage

<input type="text" v-mask="'99/99/9999'" />
<input type="text" v-mask="{mask: '99/99/9999', greedy: true}" v-on:change="maskCheck"/>
new Vue({
  ...
  methods: {
    maskCheck: function (field){
      if (field.target.inputmask.isComplete()) {
        console.log('is Complete');
      } else {
        console.log('is Incomplete');
      }
    }
  }
});

Package Sidebar

Install

npm i vue-inputmask-fork-for-nested-inputs

Weekly Downloads

1

Version

0.2.1

License

none

Unpacked Size

538 kB

Total Files

11

Last publish

Collaborators

  • ktelyakov