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

165
Vistas
Call the mounted lifecycle again

I currently have a table that uses v-for to populate the data

<table v-for="(data, idx) in dataset" :key="idx">
</table>

Then, I have two buttons that insert or delete certain things in the database after which I would like to re-populate the table to reflect these new changes.

So far, the data is captured from an API that is called in the mounted lifecycle.

mounted: function (){ 
     axios.get(....).then((response => {
           this.dataset = response.data;
     });
}

Hence, is it possible to re-call the mounted function to call the API and thus re-running the v-for?

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

0

You can just extract your loading logic into a method that can be called from multiple locations:

const Comp = {
  methods: {
    fetchData() {
      axios.get(....).then(response => {
        this.dataset = response.data;
      });
    },
    onSomeOtherAction() {
      // Do stuff.
      this.fetchData();
    },
  },
  mounted() { 
    this.fetchData();
  },
}
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