zhao/imports/ui/App.vue

49 lines
770 B
Vue
Raw Normal View History

2020-11-27 05:33:53 +00:00
<template>
<div>
2020-11-27 07:16:15 +00:00
<component
v-bind:is="whatScreen"
v-bind="currentRoom"
v-on:newGame="newGame"
v-on:joinGame="joinGame"
></component>
2020-11-27 05:33:53 +00:00
</div>
</template>
<script>
import Lobby from './components/Lobby.vue'
2020-11-27 07:16:15 +00:00
import WaitingRoom from './components/WaitingRoom.vue'
2020-11-27 05:33:53 +00:00
export default {
components: {
Lobby,
2020-11-27 07:16:15 +00:00
WaitingRoom,
2020-11-27 05:33:53 +00:00
},
data() {
return {
currentRoom: null,
whatScreen: Lobby,
};
},
2020-11-27 07:16:15 +00:00
methods: {
newGame: function(args) {
this.currentRoom = args;
this.whatScreen = WaitingRoom;
},
joinGame: function(args) {
this.currentRoom = args;
this.whatScreen = WaitingRoom;
},
}
2020-11-27 05:33:53 +00:00
}
</script>
<style>
2020-11-27 06:36:02 +00:00
body {
font-family: sans-serif;
padding: 10px;
}
2020-11-27 05:33:53 +00:00
</style>