[V4] Input masking #3148
-
Hi all, applying input masks on a strictly validated form is a common thing I guess. I'd like to ask about the proper way of doing it with V4. Back in the V3 days I used to go with cleave.js (vue-cleave-component to be precise) by following the pattern below:
With [V4] vue-cleave-component doesn't seem to work anymore. So my question is: what would be the proper way (and pattern) of input masking with [V4]? Thanks in advance, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Not sure about the problem, a code sample would've helped. For This is a small example for maska: https://codesandbox.io/s/lively-violet-jqon1?file=/src/App.vue |
Beta Was this translation helpful? Give feedback.
Not sure about the problem, a code sample would've helped.
For
maska
it seems to work fine, except you don't set the directive on the components because that's stated there that it operates on input nodes. So you either need to useField
component with scoped slots rendering or useuseField
and mask the input manually using their vanillajs guide.This is a small example for maska:
https://codesandbox.io/s/lively-violet-jqon1?file=/src/App.vue