Closed entipe closed 1 month ago
Indeed. The v-maska
does not handle array
values, only string
s or object
s. If I pass the settings as an object, including pairing your array with the mask
key, then it works.
<input type="tel" v-maska="{
mask: ['+32 ### ## ## ##', '+32 # ### ## ##'],
}" />
So the issue is that it only doesn't handle the masks passed in the array.
<input v-maska:argument.modifier="value">
value
could be one of:
string
for the mask value (should be enclosed in additional quotation marks:"'#-#'"
)object
with a default optionsSource: Usage with Vue - Maska Docs (Vue 3)
Actually, you can use an array in the data-maska
for dynamic masks:
<input
type="tel"
v-maska
data-maska="['+32 ### ## ## ##', '+32 # ### ## ##']"
/>
Example: https://stackblitz.com/edit/vitejs-vite-c3bzdy?file=src%2Fcomponents%2FHelloWorld.vue
Many thanks !
Describe the bug
With Vue, dynamic mask will be ignored.
<input type="tel" v-maska="['+32 # ### ## ##, '+32 ### ## ## ##']" />
I started with your live-demo implementation:
Steps to reproduce
Vue3 + Vite,
Use a Array for the
v-maska
attribute.Reproduction link
Reproduction link : https://stackblitz.com/edit/vitejs-vite-yx35ze?file=src%2Fcomponents%2FHelloWorld.vue