search(e) { var value = e.replace(/\D/g, '').substring(0, 11); var valueLen = value.length; console.log(valueLen) if(valueLen == 3){ this.search = `${value.substr(0,3)}`; }else if (valueLen > 3 && valueLen < 8) { this.search = `${value.substr(0,3)} ${value.substr(3)}`; } else if (valueLen >= 8) { this.search = `${value.substr(0,3)} ${value.substr(3, 4)} ${value.substr(7)}`; } }