Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

di-vue-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

di-vue-mask

Vue Mask Plugin

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
540
decreased by-6.9%
Maintainers
1
Weekly downloads
 
Created
Source

Vue mask

Input mask lib for Vue.js based on String-Mask

Installation

This version only works in Vue 2.

npm i di-vue-mask -S

Usage

import Vue from 'vue'
import VueMask from 'di-vue-mask'

/** Activate vue.js plugins **/
Vue.use(VueMask);

Basic usage on HTML input element

<input type="text" name="mask" v-model="mask" v-mask="'0000-0000'">

For custom components without v-model we can use v-mask-model

<my-input v-mask-model="mask" v-mask="'0000-0000'"></my-input>

Available masks

v-mask

<input type="text" name="mask" v-model="mask" v-mask="'0000-0000'">

v-mask-date (us|br)

<input type="text" name="date" v-model="maskDate" v-mask-date.br>

v-mask-phone (us|br)

<input type="text" name="phone" v-model="maskPhone" v-mask-phone.br>

v-mask-decimal (us|br)

<input type="text" name="decimal" v-model="maskDecimal" v-mask-decimal.br="2">

v-mask-number

<input type="text" name="number" v-model="maskNumber" v-mask-number>

v-mask-cpf

<input type="text" name="cpf" v-model="maskCpf" v-mask-cpf>

v-mask-cnpj

<input type="text" name="cnpj" v-model="maskCnpj" v-mask-cnpj>

v-mask-cep

<input type="text" name="cep" v-model="maskCep" v-mask-cep>

v-mask-cc

<input type="text" name="cc" v-model="maskCc" v-mask-cc>

Special mask characters

CharacterDescription
0Any numbers
9Any numbers (Optional)
#Any numbers (Recursive)
AAny alphanumeric character
SAny letter
UAny letter (All lower case character will be mapped to uppercase)
LAny letter (All upper case character will be mapped to lowercase)
$Escape character, used to escape any of the special formatting characters.

Keywords

FAQs

Package last updated on 13 Aug 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc