My component code (SearchResultView.vue) is like this :
<template>
...
</template>
<script>
export default{
props:['search','category','shop'],
created(){
...
},
data(){
return{
loading:false
}
},
computed:{
list:function(){
var a = this.$store.state.product;
a = JSON.stringify(a)
a = JSON.parse(a)
console.log(a.list[12])
...
}
},
methods:{
...
}
}
</script>
When I check this : console.log(a.list[12]) on the console, the result :
I want display value of name
I try like this :
console.log(a.list[12].name)
On the console, exist error like this :
[Vue warn]: Error when rendering component at C:\xampp\htdocs\chelseashop\resources\assets\js\components\SearchResultView.vue:
Uncaught TypeError: Cannot read property 'name' of undefined
How can I solve the error?

console.log(JSON.stringify(a.list[12]))?{"id":12,"name":"Bunga Gandeng","photo":"bunga6.jpg","price":762913,"stock":36,"total_sold":54,"total_view":0,"weight":68,"store_id":1,"shop_name":"Bunga Airi","formatted_address":"Kemang"}listfunction you're returning a value, but could you please add whole function's body?console.log(a.list[12])to a variable like this:var z=console.log(a.list[12])and then usez.nameand tell me whats the output after that.