di-vue-mask is a Vue.js plugin that provides input masking capabilities for HTML input elements, specifically designed for Vue 2 applications. It is currently at version 1.2.1 and has not been updated in approximately 5 years. This library differentiates itself by building upon `String-Mask` for its core masking logic and offering a variety of predefined masks such as `v-mask-date`, `v-mask-phone`, `v-mask-decimal`, `v-mask-cpf`, `v-mask-cnpj`, `v-mask-cep`, and `v-mask-cc`, along with a generic `v-mask` directive. Its release cadence is inactive, with the last significant update in v1.1.0 focusing on compatibility. A key characteristic is its strict dependency on Vue 2, meaning it is not compatible with Vue 3 or later versions.
npm install di-vue-maskVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to install and register `di-vue-mask` as a Vue 2 plugin and apply a Brazilian phone number mask to an input field using `v-mask-phone.br`.
For new projects, use a Vue 3 compatible masking library. For existing Vue 2 projects, ensure you remain on Vue 2.
Replace `v-model` with `v-mask-model` for custom components that lack `v-model` support: `<my-input v-mask-model="maskValue" v-mask="'0000-0000'"></my-input>`.
Carefully consult the documentation for the special mask characters and their exact meanings to construct correct mask patterns.
If encountering unexpected masking behavior, consider reviewing the `String-Mask` documentation or issues for deeper insight.
For Vue 3 projects, use a Vue 3 compatible masking library like `maska`, `vue-imask`, or `vue-3-mask-updated`. This package is exclusively for Vue 2 applications.
Ensure `import VueMask from 'di-vue-mask'; Vue.use(VueMask);` is called before your Vue instance is created. Verify that your project is indeed running Vue 2.