-
Notifications
You must be signed in to change notification settings - Fork 208
Open
Description
Hi
I could not find how to use custom tokens with the directive.
Edit: Watching how its done in the component I figured it out, but adding it to the documentation could save time to others in the future.
You just need to pass an object to the v-mask
<input type="tel" v-mask="{mask: '+7 (F##) ###-##-##', tokens: hexTokens}" v-model="phone"/>
You could also define it as an object
data () {
customMask: {
mask: '+7 (F##) ###-##-##',
tokens:
'F': {
pattern: /(?!8)\d/
},
'#': {pattern: /\d/}
}
}
}
<input type="tel" v-mask="customMask" v-model="phone"/>
discorick, joaovitorsilvestre, mattisthenation, ankology, DmitryScaletta and 40 morerolandszpond, P4sca1, GaboMG, Herz3h, HairCrusher and 2 morewilsonwaldo, Herz3h, HairCrusher, arikardnoir, iAnton and 8 more
Metadata
Metadata
Assignees
Labels
No labels