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

253
Views
Cómo obtener datos montados desde una llamada axios
<ion-row class="cards-wrapper"> <theme-card v-for="theme in filteredThemes" :router-link="`/theme/${theme.slug}`" :key="theme.id" :name="theme.name" :tags="theme.tags" :id="theme.id" :path="theme.image.path" ></theme-card> </ion-row> mounted() { this.getThemes(); this.filteredThemes = this.themes; console.log(this.themes); }, //in methods: async getThemes() { await axios .get("url") .then((response) => (this.themes = response.data)); },

Intenté usar async/await pero no funciona bien (probablemente lo estoy usando mal), cuando registro temas montados en la consola, no obtengo mis datos, me gustaría obtener datos de mi llamada api montada. Sé que esto tiene algo de asincronía, ¿puedes darme una pista de qué hacer? ¡¡¡Muchísimas gracias!!!

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

0

Si aún no obtiene datos, intente así:

 async mounted() { await this.getThemes(); this.filteredThemes = this.themes; },

//en métodos:

 async getThemes() { await axios .get("url") .then((response) => (this.themes = response.data)); },
about 4 years ago · Juan Pablo Isaza Report

0

.then((response) => (this.themes = response.data));

usar una función de flecha cambia lo que es this , parece que algunas personas lo escriben así:

 const that = this; await axios .get("url") .then((response) => (that.themes = response.data));
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!