While working on my Vue Js project, I encountered an issue with displaying data from an API in JSON format. Despite using
this.obj =JSON.stringify(this.Flats);
and successfully seeing all the data using console.log, I struggled to loop over and view the payment
object.
https://i.sstatic.net/J4Giz.png
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>