Syntactically the code works well as it is. I don’t have Vue currently, but passing the object to a fake extend method results in it being successfully output to the console:
Excellent. Thank you very much. I may not be the man to help you with that as I have no experience with Vue, but we do now have enough information (thank you) for someone else to help you with this issue.
All I can suggest is that instead of pusing a new object:
Sorry for bad explanation, I was in hurry so just now I noticed that I didn’t give any info about my problem.
So it’s here:
As you see I have one fake item array that contain object (in this case the product), and one empty array bag (shopping cart) where I want the store selected item - below is addToBag method that should add product to the bag array after clicking on button, but for some reasons it pass only empty object to bag array - so that’s the main issue.