Vue inputmasked v3

Super tiny input mask library for Vue.js based on PureMask.js (~2kb) exposed as directive. No dependencies

Version: 1.3.5 Updated: 05/15/2018

By: adv-team-plugins License: MIT

Downloads Last 30 Days: 15

:cd: Installation

npm i vue-inputmasked-2


ES2015 (Webpack/Rollup/Browserify/etc)

import Vue from 'vue'

// As a plugin
import VueMask from 'vue-inputmasked'

// Or as a directive
import { VueMaskDirective } from 'vue-inputmasked'
Vue.directive('mask', VueMaskDirective);

:rocket: Usage

<input type="text" v-mask="'####-##'" v-model="myInputModel">
<!-- OR -->
<input type="text" v-mask="nameOfVariableWithMask" v-model="myInputModel">

:gear: Configs

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
? Optional (next character)

:syringe: Tests

Jest is used for unit-tests.

You can run tests by typing this command in your console:

npm test

:anchor: Semantic Versioning Policy

This plugin follows semantic versioning.

:lock: License

See the LICENSE file for license rights and limitations (MIT).

Categories: Vue js