This commit is contained in:
sschum 2023-07-13 15:09:26 +02:00
parent 4ee9969860
commit 51024df8e8
2 changed files with 3 additions and 2 deletions

View File

@ -26,7 +26,8 @@
<div class="row">
<div class="col-6" v-for="(card, i) of cards" :key="card.id">
<card :css-class="i % 2 === 0 ? 'bg-primary' : 'bg-secondary'">
<card :css-class="i % 2 === 0 ? 'bg-primary' : 'bg-secondary'"
v-on:card-click="removeCard(i)">
{{ card.content }} ({{ card.id }})
</card>
</div>

View File

@ -1,7 +1,7 @@
MyVueApp.component('card', {
props: ['cssClass'],
template: `
<div class="card">
<div class="card" v-on:click="$emit('card-click')">
<div :class="cssClass">
<div class="card-body">
<h5 class="card-title">