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

147
Vistas
I don't want to rerender the page when changing the dynamic params on Nuxt

I have a simple page with two dynamic params when I'm on the page and changing the URL params fetch method will run again. I don't want this behavior.

fetch method:

async fetch() {
    await this.getFlightResult();
}

getResult Method:

async getResult() {

    this.$router.push({
        path: `/air/${originCity?.id}-${destinationCity?.id}/${originCity?.name}-${destinationCity?.name}`,
    });
    await this.getFlightResult();
}

getResultMethod:

async getFlightResult(){
   const { data } = await this.$axios.get(`/api/v1/flights')
}

I have this code when changing the URL params run fetch method and getResult method together and it causes this happen.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can change the query parameters without changing the path parameter and so, not re-rendering the page:

this.$router.push({query: { myFirstQuery: 'foo', mySecondQuery: 'bar'}})

You can then watch the queries with for example :

watch: {
    '$route.query': {
      immediate: true,
      handler(newVal){
        // updating your values here
      }
    }
  }
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