I am facing an issue with retrieving data from a Vue.js app object.
data() {
return {
group1: {
id: 'qd4TTgajyDexFAZ5RKFP',
owners: {
john: {age: 32, gender: 'man'},
mary: {age: 34, gender: 'woman'},
}
}
}
}
The problem arises when I try to access Mary's age within the Vue template as follows...
I can successfully access owners
using this code snippet...
<p>{{group1.owners}}</p>
However, when attempting to go deeper like this...
<p>{{group1.owners.mary.age}}</p>
...an error occurs indicating that it cannot retrieve mary
as undefined.
"TypeError: Cannot read properties of undefined (reading 'id')"
If anyone has a solution to this issue, please let me know. Thank you!