Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

161
Vistas
Using filter with slice array methods not working

I have a search input that I use to filter an array of users that are shown in a table. This table includes pagination so I'm using .slice to get 10 users to show on the table per page. For some reason, the search filtering works if I'm on page 1 (guessing because there's no slice on page 1?); after going to another page, the filtering stops working, this is to do with .slice since it works if I remove the .slice code. Any ideas why this is? There's something I'm not seeing here..

tableData() {
      return this.users
        .filter(
          (user) =>
            user.firstName.toLowerCase().includes(this.search.toLowerCase()) ||
            user.lastName.toLowerCase().includes(this.search.toLowerCase()) ||
            user.email.toLowerCase().includes(this.search.toLowerCase()),
        )
        .slice(this.perPage * (this.currentPage - 1), this.perPage * this.currentPage);
    },
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It s because your result is now on the first page or somewhere before.

You are slicing the result.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda