Value Vue-the-Mask conditional formatting

Asked

Viewed 505 times

3

I’m trying to put a mask on - Vue-the-Mask

<the-mask 
    id="input1" 
    v-model="ch_anual" 
    type="text" 
    :mask="['###:##', '#.###:##']" 
/>

But you’re only taking the second mask if I put ###.###.###-##, ##.###.###/####-## works

jsFiddle: https://jsfiddle.net/luissouza/4vdsepun/

1 answer

0

This happens because you have two masks acting in the same segment, which would be of the 5 digit, ie in the first mask you have the mask acting in the 5 character applying ###-## and at the same time you have the other mask acting applying #.###-#

It may seem confusing but this component it acts on the control characters in this case 2 2 acting on 5 character.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.