What problem does this feature solve?
Help user input data in a formated way and avoid error and/or confusion.
What does the proposed API look like?
<Input v-model="myCreditCard" placeholder="Enter something..." mask="####-####-####-####" />
1234-5678-0123-4567
<Input v-model="myCreditCard" placeholder="Enter something..." mask="AAA-a###" />
FGA-c452
the onchange event could emit if the input fit the mask. If a letter is inserted in place of a number, we could show a message under the field explaining how to fill that field.
1条答案
按热度按时间oo7oh9g91#
It could accept something like VueTheMask or just give us access to the input (by ref or something) so we can put it ourselves.