🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

ionic-vue-input-mask

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ionic-vue-input-mask

Uma biblioteca para adicionar máscaras a campos de entrada Vue.

1.0.7
latest
npm
Version published
Weekly downloads
2
-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Ionic Vue Input Mask

npm npm npm

A lightweight (2KB gzipped) and dependency free mask input created specific for Vue.js

Docs and Demo

Install

yarn add npm i ionic-vue-input-mask
or
npm i -S npm i ionic-vue-input-mask

Usage (two flavors)

Global as plugin

import Mask from 'ionic-vue-input-mask'
Vue.use(Mask)

Global as directive

import {VMask} from 'ionic-vue-input-mask'
Vue.directive('mask', VMask)

Local (as directive)

import {VMask} from 'ionic-vue-input-mask'
export default {
  directives: {VMask}
}

Input

<input v-mask="'##/##/####'" />

Ion Input

<ion-input v-mask="'##/##/####'" />

Multiple masks

<input v-mask="['##/##/####', '##-##-####']" />

Tokens

'#': {pattern: /\d/},
'X': {pattern: /[0-9a-zA-Z]/},
'S': {pattern: /[a-zA-Z]/},
'A': {pattern: /[a-zA-Z]/, transform: v => v.toLocaleUpperCase()},
'a': {pattern: /[a-zA-Z]/, transform: v => v.toLocaleLowerCase()},
'!': {escape: true}

Properties

PropertyRequiredTypeDefaultDescription
valuefalseStringInput value or v-model
masktrueString, ArrayMask pattern
maskedfalseBooleanfalseemit value with mask chars, default is raw
placeholderfalseStringSame as html input
typefalseString'text'Input type (email, tel, number, ...)
tokensfalseObjecttokensCustom tokens for mask

Contribution

You're free to contribute to this project by submitting issues and/or pull requests. This project is test-driven, so keep in mind that every change and new feature should be covered by tests. Your name will be added to the hall of fame ;)

The Mask Wolf

Hall of Fame

Contributors

Based on Vue-The-Mask

License

This project is licensed under MIT License

Keywords

vue

FAQs

Package last updated on 20 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts