Skip to content

Commit c5b6475

Browse files
committed
Make a list that we can add things to.
1 parent 137b37d commit c5b6475

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

index.html

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,23 @@
1212
<option value="icon-spades">Card Game</option>
1313
</select>
1414
<input v-model="game">
15-
<p>
16-
<span :class="type"></span>
17-
{{ game }}
18-
</p>
15+
<button @click="games.push({game: game, type: type})">Add</button>
16+
<p v-if="games.length == 0">Zarro Boords!</p>
17+
<ul v-else>
18+
<li v-for="g in games">
19+
<span :class="g.type"></span>
20+
{{ g.game }}
21+
</li>
22+
</ul>
1923
</div>
2024
<script src="node_modules/vue/dist/vue.js"></script>
2125
<script>
2226
var app = new Vue({
2327
el: '#app',
2428
data: {
25-
game: 'Snakes and Ladders',
26-
type: 'icon-dice'
29+
game: '',
30+
type: 'icon-dice',
31+
games: []
2732
}
2833
})
2934
</script>

0 commit comments

Comments
 (0)