This commit is contained in:
sschum 2023-07-13 14:48:15 +02:00
parent b4241566b6
commit 0b840d140a

View File

@ -18,18 +18,29 @@
</p> </p>
<a href="#" class="btn btn-primary" v-on:click="addCard">Add Card</a> <a href="#" class="btn btn-primary" v-on:click="addCard">Add Card</a>
</div> </div>
<div class="row">
<div class="col-6" v-for="card of cards">
<div class="card">
<div class="card-body">
<h5 class="card-title">{{ card }}</h5>
</div>
</div>
</div>
</div>
</div> </div>
<script> <script>
const MyVueApp = Vue.createApp({ const MyVueApp = Vue.createApp({
data() { data() {
return { return {
message: 'Hello Vue!' message: 'Hello Vue!',
cards: [],
} }
}, },
methods: { methods: {
addCard() { addCard() {
alert(this.message) this.cards.push(this.message)
} }
} }
}) })