I want to display an array elements in my Vuejs template.
I am getting data from API, formatting them into an associative Array with a function and then trying to display in the template.
When i try to access the first element which is “name”, with this code :
{{ this.info.name }}
I get the error :
Uncaught (in promise) TypeError: Cannot read properties of null
(reading ‘name’)
But when i try this at the exact same place in code :
{{ this.info }}
I can see that array is defined :
{ "name": "B3", "call": "about", "G": "H" }
Also, I get the right data when i try to console log in my mounted() component function :
console.log(this.info.name)
For info, the Object type when doing in the mounted() function :
console.log(this.info)
is :
Proxy(Object) {name: 'B3', call: 'about', G: 'H'}
What is wrong in the way I am trying to access data getting me this error ?