实时清除除数字以外的字符

keyup事件里放

this.phone = this.phone.replace(/[^\d]/g, ""); //清除“数字”以外的字符

你可能感兴趣的:(实时清除除数字以外的字符)