Paulo Vieira ceb95791be Game
Games
2018-01-09 10:46:22 +00:00

36 lines
784 B
Vue

<template>
<table class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>Player 1</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr v-for="game in games" :key="game.gameID">
<td>{{ game.gameID }}</td>
<td>{{ game.player1 }}</td>
<td>
<a class="btn btn-xs btn-primary" v-on:click.prevent="join(game)">Join</a>
</td>
</tr>
</tbody>
</table>
</template>
<script type="text/javascript">
// Component code (not registered)
module.exports={
props: ['games'],
methods: {
join(game) {
this.$emit('join-click', game);
},
},
}
</script>
<style scoped>
</style>