Add methods for joining a game.
This commit is contained in:
parent
daa83b2da6
commit
810ea4f677
1 changed files with 17 additions and 1 deletions
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue