Add methods for joining a game.

This commit is contained in:
Oliver-Akins 2020-09-19 17:13:09 -06:00
parent daa83b2da6
commit 810ea4f677

View file

@ -10,15 +10,24 @@
id="username"
name="User Name"
v-model="username"
@keyup.enter.stop="$refs.gamecode.focus()"
>
<br>
<label for="gamecode">Game Code:</label>
<input
ref="gamecode"
type="text"
id="gamecode"
name="Game Code"
v-model="game_code"
@keyup.enter.stop="try_game_code"
>
<br>
<button
@click.stop="try_game_code"
>
Join Game
</button>
</div>
</div>
</template>
@ -31,7 +40,14 @@ export default {
game_code: ``,
username: ``,
}},
methods: {},
methods: {
try_game_code() {
if (this.game_code.length > 0) {
alert('The game code you have entered is invalid.');
this.game_code = ``;
}
},
},
}
</script>