Begin foundational logic in order of webpage state
This commit is contained in:
parent
c2ad722758
commit
e35a57ffd8
1 changed files with 36 additions and 16 deletions
52
src/App.vue
52
src/App.vue
|
|
@ -1,27 +1,47 @@
|
|||
<template>
|
||||
<div id="app">
|
||||
<img alt="Vue logo" src="./assets/logo.png">
|
||||
<HelloWorld msg="Welcome to Your Vue.js App"/>
|
||||
</div>
|
||||
<div id="app">
|
||||
<WS-Entry
|
||||
v-if="state == 'ws-url'"
|
||||
@set-ws-url="websocket_url = $event"
|
||||
/>
|
||||
<Game-Code
|
||||
v-else-if="state == 'game-code'"
|
||||
@set-game-code="game_code = $event"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HelloWorld from './components/HelloWorld.vue'
|
||||
import GameCodeEntry from `./components/GameCode`;
|
||||
import WebsocketEntry from `./components/WebsocketURL`;
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {
|
||||
HelloWorld
|
||||
}
|
||||
name: 'App',
|
||||
components: {
|
||||
'WS-Entry': WebsocketEntry,
|
||||
'Game-Code': GameCodeEntry,
|
||||
},
|
||||
data() {return {
|
||||
state: `ws-url`,
|
||||
websocket_url: ``,
|
||||
game_code: ``,
|
||||
}},
|
||||
methods: {
|
||||
set_ws(ws_uri) {
|
||||
this.websocket_url = ws_uri;
|
||||
this.state = `game-code`;
|
||||
},
|
||||
set_gamecode(gamecode) {
|
||||
this.game_code = gamecode;
|
||||
this.state = `game`;
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
#app
|
||||
font-family Avenir, Helvetica, Arial, sans-serif
|
||||
-webkit-font-smoothing antialiased
|
||||
-moz-osx-font-smoothing grayscale
|
||||
text-align center
|
||||
color #2c3e50
|
||||
margin-top 60px
|
||||
#app {
|
||||
height: 100vh
|
||||
width: 100vw
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue