Answer the question
In order to leave comments, you need to log in
How to cut phone characters?
I am using the v-mask library.
This is the code for input
input(
v-model='phone',
v-mask="'+7 (###) ###-##-##'",
type='text',
placeholder='+7 (913) 888-88-88'
)
let phone = this.phone.slice('4').split('');
phone = phone.filter((item) => {
if (item !== ')' && item !== ' ' && item !== '-') {
return item;
}
return false;
});
phone = phone.join('');
const data = {
phone,
password: this.password,
};
Answer the question
In order to leave comments, you need to log in
const data = {
phone: this.phone.replace(/\D/g, ''),
password: this.password,
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question