Answer the question
In order to leave comments, you need to log in
Why doesn't the mask work in my component?
I took the component https://github.com/ankurk91/vue-flatpickr-component as a basis, but it is not possible to add a mask there, I do it with this lib https://www.npmjs.com/package/v-mask, and I decided to take the date component and try to add a mask. The component appeared and the data-mask tag appeared, but it is not processed, you can enter anything there.
In the sandbox example, it does not display correctly there, but you can see the whole code how I implemented it https://codesandbox.io/embed/k2jn4jox7o?fontsize=14
render(el) {
return el("input", {
attrs: {
type: "text",
"data-input": true
},
directives: [
{
name: "mask",
value: "##.##.####"
}
],
props: {
disabled: this.disabled
},
on: {
input: this.onInput
}
});
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question