so I have an object of arrays, each array contains a certain object, now what I wanna do is when I click on any of those objects to be able to select it so I can preview it in VueJs
here's my object:
shopitems:{
pizza:[
{
"id": 1,
"name": "id labore ex et quam laborum",
"email": "[email protected]",
"body": "Margherita",
"img" : " https://media.onebite.app/62/b2/c5/f7/62b2c5f7-a995-47a6-af1b-64d892692386.jpg",
"brand" : "pizza",
"price": "12",
},
{
"id": 2,
"name": "odio adipisci rerum aut animi",
"body": "Fresh Veggie",
"img" : "https://res-2.cloudinary.com/crunchbase-production/image/upload/c_lpad,h_256,w_256,f_auto,q_auto:eco/r6krxkmxkkthsbw9fm9f",
"brand" : "pizza",
"price": "30",
},
],
salad:[
{
"id":3,
"name": "id labore ex et quam laborum",
"email": "[email protected]",
"body": "Salad u",
"img" : "https://nitrocdn.com/KZJKWDkEwMJCwERIlnRsPNdqobwBIlEo/assets/static/optimized/rev-83d0269/wp-content/uploads/2018/05/brazilian-chopped-salad-10-256x256.jpg",
"brand" : "salad",
"price": "12",
},
{
"id": 4,
"name": "odio adipisci rerum aut animi",
"body": "Salad V",
"img" : "https://bigoven-res.cloudinary.com/image/upload/d_recipe-no-image.jpg,t_recipe-256/mixed-greens-salad-with-tomato-443eb4.jpg",
"brand" : "salad",
"price": "25",
},
],
},
this is my function that I tried to use
this.$store.state.eCommerce.shopitems.find((items) =>
items.forEach((item) => item.id = id))
return this.item_data = this.item
please kindly tell me what am I doing wrong