Mask for Vue.js 3
v-mask
is a directive for Vue.js 3 that allows you to mask input fields.
This package inspired by vue-the-mask
npm install @ssibrahimbas/v-mask
import { createApp } from "vue";
import VMask from "@ssibrahimbas/v-mask";
const app = createApp(App).use(VMask).mount("#app");
<input v-mask="'###-##-##'" />
Token | Description |
---|---|
# |
Digit |
X |
Any character |
S |
Any text character |
A |
Any uppercase character |
a |
Any lowercase character |
! |
Any alphanumeric character |
Option | Type | Default | Description |
---|---|---|---|
mask |
String |
'' |
Mask to be applied to the input |