I'm trying to use the mask property of text-field component, like the example below. In the view, that works like a charm, but, when the form is posted, the mask format does not keep the value.
For example, when I type "000.000.000-00", the value that the form posted was "00000000000". How can I keep the format value?
<v-text-field
:value="currentValue"
@input="handleInput"
:mask="###.###.###-##"></v-text-field>
You can use return-masked-value
prop
<v-text-field
:value="currentValue"
return-masked-value
mask="###.###.###-##"
@input="handleInput"
></v-text-field>
Note that currently in v0.17
there is a bug with returning unmasked initial value.
来源:https://stackoverflow.com/questions/47857673/how-to-use-mask-in-vuetify-text-field