'Axios return of nested JSON file
I am trying to return the 'title' from my JSON file but I can't seem to get the correct path. At the moment 'resultPacket' is returning info but when I try and get into the 'results - metaData' it's not returning anything.
Can someone help?
VueJS axios call section
<script>
import axios from "axios";
export default {
data() {
return {
results: [],
title: "",
};
},
props: {
result: Object,
},
mounted() {
axios
.get(
"**myURL is here - I cant share**"
)
.then((response) => {
**this.results = response.data.response.resultPacket;**
})
.catch((error) => {
console.log(error);
this.errored = true;
})
.finally(() => (this.loading = false));
},
};
JSON
response": {
"resultPacket": {
"querySystemRaw": null,
"results": [
{
"rank": 1,
"score": 1000,
"metaData": {
"title": "This is the title",
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
