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

Apply mask to default value. #7

Closed xereda closed 7 years ago

xereda commented 7 years ago

First of all, congratulations for the initiative. Excellent job.

How do I get the value to be formatted in an assignment to the v-model variable?

The mask works in the course of typing only. Is there a way to apply the mask to the default value of an input?

Thank you very much for your time.

caioincau commented 7 years ago

Hi @xereda, thanks! You can't just format your default value with a getter or a computed property?

xereda commented 7 years ago

Excuse me, but I do not understand. The mask is only applied when the field is typed, right? How do I make the value formatted without typing? What I need is to set the mask, set in the "v-mask" property, when I assign a value to the variable of my v-model. When you open the form with the value filled in, the mask has already been applied to the field.

caioincau commented 7 years ago

We do not have this feature yet, I wil discuss with moip team about the viability of this feature.

caioincau commented 7 years ago

Support added to default value at version 0.3.6

xereda commented 7 years ago

Yeah! It's working perfectly! Many thanks, my friend.