[Vuejs]-Axios request get value from nested array in Vue

1๐Ÿ‘

โœ…

As noted in the comments, response.data.items is a string, not an object. This seems like a flawed API response, with the items unnecessarily encoded as a JSON string within the response.

However, assuming that fixing the problem in the server is not possible, the items can be decoded in the UI:

this.results = JSON.parse(response.data.items);
this.result = this.results[0]['1:B'];
๐Ÿ‘คskirtle

Leave a comment