iview [Feature Request]Input mask

bvjveswy  于 4个月前  发布在  其他
关注(0)|答案(1)|浏览(57)

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.

oo7oh9g9

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.

相关问题