wirecardBrasil / awesome-mask

The awesome-mask runs with Vue.js and uses the vanilla-masker to make your form awesome with masks.
MIT License
165 stars 22 forks source link

Can't make updateMask work #27

Closed tiagocborg closed 7 years ago

tiagocborg commented 7 years ago

I am trying o use the updatemask found at the example page, but it doesn't work. Only works with longest value. The short one never works.

< input v-mask="mask" @input="_updateMask" >

methods: { _updateMask (ev) { console.log(ev.target.value) if (ev.target.value.length > 14) { this.mask = '99.999.999/9999-99' } else { this.mask = '999.999.999-999' } } }

caioincau commented 7 years ago

It's working at the example example page, if it is not working with you, probably it's not a problem with the mask itself.

You can check the example code at: https://github.com/moip/awesome-examples/blob/master/src/App.vue