Answer the question
In order to leave comments, you need to log in
How to pass an array from one component to another in Vue?
There is a “conponents” folder where there are two components. The first component has an array that is traversed and information is displayed in the cards. There is a button on the card that adds one of the cards to favorites (that is, to another array in the same component). How can I pass an array with a favorite to another component so that it can be iterated over and output everything?
Answer the question
In order to leave comments, you need to log in
Use events.
// Генерируем событие, возможно с передаваемыми данными
this.$emit('название' [, данные]);
// Слушаем событие
this.$on('название', function(данные) {...});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question