This commit is contained in:
syuilo
2018-08-05 13:40:26 +09:00
parent b68f74f39c
commit 128a201b9d
6 changed files with 84 additions and 23 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div>
<x-room v-if="!g.isStarted" :game="g" :connection="connection"/>
<x-game v-else :init-game="g" :connection="connection"/>
<x-game v-else :init-game="g" :connection="connection" :self-nav="selfNav" @go-index="goIndex"/>
</div>
</template>
@@ -16,7 +16,16 @@ export default Vue.extend({
XGame,
XRoom
},
props: ['game'],
props: {
game: {
type: Object,
required: true
},
selfNav: {
type: Boolean,
require: true
}
},
data() {
return {
connection: null,
@@ -36,6 +45,9 @@ export default Vue.extend({
onStarted(game) {
Object.assign(this.g, game);
this.$forceUpdate();
},
goIndex() {
this.$emit('go-index');
}
}
});