2
0
mirror of https://github.com/tenrok/maska.git synced 2026-06-20 20:00:34 +03:00

Updated docs and readme

- add autocomplete attributes and 'tel' type
This commit is contained in:
Alexander Shabunevich
2019-09-27 22:12:19 +03:00
parent bd2d5e0075
commit 80b25a0ce7
2 changed files with 25 additions and 8 deletions
+14 -1
View File
@@ -12,6 +12,12 @@ Simple zero-dependency input mask for Vue.js and vanilla JS. [Demo and examples]
npm install maska
To load latest version from CDN you can use:
``` html
<script src="https://cdn.jsdelivr.net/npm/maska/dist/maska.js"></script>
```
## Usage with Vue.js
If you load Vue.js via `<script>` then just add `v-maska` directive to your input:
@@ -26,7 +32,14 @@ You can add custom tokens by passing in object instead of string to directive:
<input v-maska="{ mask: 'Z*', tokens: { 'Z': { pattern: /[а-яА-Я]/ }}}">
```
If you use SFC then import `directive` component from library:
With bundlers you can add global directive:
``` javascript
import Maska from 'maska'
Vue.use(Maska)
```
or import `maska` directive for local usage in component:
``` html
<template>