html – vue-the-mask value conditional formatting

Question:

I'm trying to put on a mask – vue-the-mask

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

But, it's only taking the second mask if I put on ###.###.###-## , ##.###.###/####-## works

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

Answer:

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

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

Scroll to Top