November 2017
Beginner to intermediate
398 pages
8h 42m
English
Now, we need to handle the 'play' event in the hand component we emit in the cards when the user clicks on them, and emit a new 'card-play' event to the main component with an additional argument--the played card in question.
methods: { handlePlay (card) { this.$emit('card-play', card) }, },
<card v-for="card of cards" :def="card.def" @play="handlePlay(card) />
To test ...
Read now
Unlock full access