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"
|
id="username"
|
||||||
name="User Name"
|
name="User Name"
|
||||||
v-model="username"
|
v-model="username"
|
||||||
|
@keyup.enter.stop="$refs.gamecode.focus()"
|
||||||
>
|
>
|
||||||
<br>
|
<br>
|
||||||
<label for="gamecode">Game Code:</label>
|
<label for="gamecode">Game Code:</label>
|
||||||
<input
|
<input
|
||||||
|
ref="gamecode"
|
||||||
type="text"
|
type="text"
|
||||||
id="gamecode"
|
id="gamecode"
|
||||||
name="Game Code"
|
name="Game Code"
|
||||||
v-model="game_code"
|
v-model="game_code"
|
||||||
|
@keyup.enter.stop="try_game_code"
|
||||||
>
|
>
|
||||||
|
<br>
|
||||||
|
<button
|
||||||
|
@click.stop="try_game_code"
|
||||||
|
>
|
||||||
|
Join Game
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -31,7 +40,14 @@ export default {
|
||||||
game_code: ``,
|
game_code: ``,
|
||||||
username: ``,
|
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>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue