v-mask
v-mask copied to clipboard
Get raw value
Is there a way to get the raw value without any formatting?
Raw value: 5555555555 Formatted: 555-555-5555
Regards,
+1 - would like to know if this is possible
Currently it's not stored inside v-mask
. Sounds like a feature request
Agree. Would be great that the v-model value reflects the raw input rather than the formatted input.
It's going to be fixed in #278
+1 on this. currently using v-mask as directive i was looking for something like v-mask.raw="'##-##-##'"
displayed value = '11-22-33' actual value in model = 112233
thanks
It would be nice a directive "masked=true|false" to update the v-model with/without the mask.
thanks!
We still cant do this? lol
Update: you can use my repo, it create a data attribute on the input with the name of unmasked and you can retrieve the raw value from it
https://github.com/bw2tecnologia/v-mask
+1 for this. If the directive could return the raw value this would be the perfect masking choice for vue
+1
+11111111
+1
+1
For anyone looking for a simple solution!
You can make a simple mask-field component where you can parse raw value from masked value.
getRawValue(value) {
const rawValueArray = []
this.mask.split('').forEach((character, i) => {
if (character === '#') {
charArray.push(value[i])
}
})
return rawValueArray.join('')
},
This would be incredible if is native!!
Any progress for this one?
+1
+1
+1
bump
+1
Would be greatly appreciated!
+1