This commit is contained in:
sschum 2023-07-13 15:02:53 +02:00
parent 6abb9bcf8d
commit ad97f8c66b
2 changed files with 15 additions and 7 deletions

View File

@ -26,13 +26,7 @@
<div class="row">
<div class="col-6" v-for="(card, i) of cards" :key="card.id">
<div class="card" v-on:click="removeCard(i)">
<div :class="i % 2 === 0 ? 'bg-primary' : 'bg-secondary'">
<div class="card-body">
<h5 class="card-title">{{ card.content }} ({{ card.id }})</h5>
</div>
</div>
</div>
<card></card>
</div>
</div>
</div>
@ -74,6 +68,9 @@
}
}
})
</script>
<script src="./js/card.js"></script>
<script>
MyVueApp.mount('#app')
</script>
</body>

11
src/js/card.js Normal file
View File

@ -0,0 +1,11 @@
MyVueApp.component('card', {
template: `
<div class="card">
<div>
<div class="card-body">
<h5 class="card-title"></h5>
</div>
</div>
</div>
`
})