My code is like this :
<script>
export default {
props:['search','category','shop'],
created(){
...
},
data(){
return{
loading:false
}
},
computed:{
...
list:function(){
console.log(this.$store.state.product);
return this.$store.state.product.list
},
},
methods:{
...
}
}
</script>
I do : console.log(this.$store.state.product);
in list method
Then, I check it on the console
The result is like this :
I want display value of name
I try like this :
console.log(this.$store.state.product.list.id.name);
There exist error :
Uncaught TypeError: Cannot read property 'name' of undefined
How can I solve the error?