use-mask-input@3.12.0
Minor Changes
-
0b5757d: Add Vue 3 support via a new
use-mask-input/vueentry point.Two exports: a
vMaskInputdirective and auseMaskInputcomposable. In<script setup>the directive needs no registration and no plugin — Vue resolvesvMaskInputtov-mask-inputon its own.<script setup> import { vMaskInput } from "use-mask-input/vue"; </script> <template> <input v-mask-input="'cpf'" /> <input v-model="cpf" v-mask-input="{ mask: 'cpf', options: { autoUnmask: true } }" /> </template>
v-modelworks with no adapter, and vee-validate 4 needs no integration code at all: withautoUnmask, field state and submit values receive the raw value while the input keeps displaying the mask.Also:
reactandreact-domare now optional peer dependencies, so installing the package in a Vue project no longer warns about missing React.vueandvee-validateare optional peers. The Vue entry never imports React.
Patch Changes
-
0b5757d: Vue: binding
nulltov-mask-inputnow removes a mask that is already on the element.The binding is reactive, so
v-mask-input="enabled ? 'cpf' : null"reads as a toggle. Previously switching it off left the previous Inputmask instance attached and the field kept formatting.