Open cesartagplus opened 1 year ago
Hi!
I have a dynamic mask, and when the mask changes (based on another inputs) it cleans the field. I want to prevent this, and clean the field only if the test fails. Is there a way ?
the code looks like this:
<el-input v-model="test" v-mask="customMask" />
watch: { inputC: { immediate: true, handler () { this.customMask = this.changeMask(inputA, inputB) } } }
methods: { changeMask = (inputA, inputB) => { let actualMask = [] if (inputA) { actualMask = [/1/, '.', /\d/, /\d/, /\d/] } if (inputB) { actualMask = [/2/, '.', /\d/, /\d/, /\d/] } return actualMask } }
Hi!
I have a dynamic mask, and when the mask changes (based on another inputs) it cleans the field. I want to prevent this, and clean the field only if the test fails. Is there a way ?
the code looks like this: