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

422
Views
Vue Js: cómo ver objetos desde la API JSON

en mi proyecto Vue Js tengo datos de la API, y en JSON hay objetos almacenados y no puedo verlos en mi código. Intenté usar this.obj =JSON.stringify(this.Flats); y cuando lo consuelo, lo registro, puedo ver todos mis datos, pero no pude pasarlos por encima para ver el objeto de payment

ingrese la descripción de la imagen aquí

 BuildingsService.getAllFlats().then((response) => { this.Flats = response.data.response; this.obj =JSON.stringify(this.Flats); console.log(this.Flats,"dataaa") });
 <div v-for="(object,index) in obj" :key="index"> //didn't work <span> {{object.flat_number}} </span> <span > {{object.payment}} </span> </div>

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

0

No se puede agregar a través de comentarios, pero probablemente

no puedo leer la propiedad de pago

error debido a que la matriz tiene algunos objetos que no incluyen el objeto de pago. Creo que implementar v-if="object.payment" resolverá su problema.

about 4 years ago · Juan Pablo Isaza Report

0

Está capturando la matriz en Flats pero está usando JSON.stringify y almacenando la cadena resultante en obj ... luego registrando la matriz pero esperando iterar a través de la cadena.

Prueba esto

 BuildingsService.getAllFlats().then((response) => { this.Flats = response.data.response; this.obj = this.Flats // transforming to a string and duplicating the variable seems kinda pointless btw });

O simplemente recorra la matriz que ya está almacenando

 <div v-for="(object,index) in Flats" :key="index"> // should work
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!