Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

116
Views
Vue JS: filtro de búsqueda de números

mi código a continuación funciona bien cuando busco letras, pero cuando se trata de números como flat_number solo me da error flat.flat_number.toLowerCase is not a function

 filteredList() { return this.Flats.filter((flat) => { return ( //i tried commented code but it didn;t work // this.Flats.filter(flat_number => String(flat_number).includes(this.search)) || flat.buyer .toLowerCase() .includes(this.search.toLowerCase()) || flat.flat_number //flat_number not working .toLowerCase() .includes(this.search.toLowerCase()) || flat.city .toLowerCase() .includes(this.search.toLowerCase()) ); }); },

alguna ayuda por favor?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

No hay una función toLowerCase para Number .

Si desea tratar plano como un tipo de cadena, realice esa conversión antes de comparar con la cadena de búsqueda.

 filteredList() { return this.Flats.filter((flat) => { return ( flat.buyer.toString() .toLowerCase() .includes(this.search.toLowerCase()) || flat.flat_number.toString() .toLowerCase() .includes(this.search.toLowerCase()) || flat.city.toString() .toLowerCase() .includes(this.search.toLowerCase()) ); }); },
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!