Vue jQuery Mask Component
Vue.js component for jQuery Mask Plugin.
Version matrix
Vue.js version | Package version | Branch |
---|---|---|
2.x | 1.x | 1.x |
3.x | 2.x | master |
Requirements
- jQuery >=1.7.0
- Vue 3.x
Installation
Using Webpack?
- Webpack users need to configure ProvidePlugin
Usage Example
As plugin
This will register a global component <vue-mask>
Available props
The component accepts these props:
Attribute | Type | Default | Required? | Description |
---|---|---|---|---|
v-model | String / null |
null |
true |
Set or Get input value |
mask | String / Function |
|
true |
Masking pattern |
options | Object | {} |
false |
Configuration options |
raw | Boolean | true |
false |
When set to false ; emits formatted value with format pattern and delimiters |
Install in non-module environments (without webpack)
Run examples on your localhost
- Clone this repo
- You should have node-js
>=10.13
and yarn>=1.x
pre-installed - Install dependencies -
yarn install
- Run webpack dev server -
yarn start
- This should open the demo page at
http://localhost:9000
in your default web browser