Vue · Junior · Question 65 of 75

How does the parent receive the value sent with emit('select', id)?

<ItemList @select="onSelect" />

function onSelect(id) { /* ... */ }

Explanation

Extra arguments of emit are passed to the listener. In an inline handler the first one is available as $event.

Further reading

Problem with a question

Vue · Junior · question 65

Test yourself

Take the Vue · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz