From cbcf3fd7f1dd8a8a6f92d598712c0f6d97e227f9 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 3 Aug 2018 22:34:58 +0900 Subject: :v: --- .../views/components/games/reversi/reversi.vue | 33 ++++++++++++++-------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'src/client/app/common') diff --git a/src/client/app/common/views/components/games/reversi/reversi.vue b/src/client/app/common/views/components/games/reversi/reversi.vue index 4169a5465a..60d46307e8 100644 --- a/src/client/app/common/views/components/games/reversi/reversi.vue +++ b/src/client/app/common/views/components/games/reversi/reversi.vue @@ -10,7 +10,7 @@
- +
@@ -19,6 +19,7 @@ import Vue from 'vue'; import XGameroom from './reversi.gameroom.vue'; import XIndex from './reversi.index.vue'; +import Progress from '../../../../scripts/loading'; export default Vue.extend({ components: { @@ -26,7 +27,12 @@ export default Vue.extend({ XIndex }, - props: ['initGame'], + props: { + gameId: { + type: String, + required: false + } + }, data() { return { @@ -39,14 +45,15 @@ export default Vue.extend({ }, watch: { - game(g) { - this.$emit('gamed', g); - } - }, - - created() { - if (this.initGame) { - this.game = this.initGame; + gameId(id) { + console.log(id); + Progress.start(); + (this as any).api('games/reversi/games/show', { + gameId: id + }).then(game => { + this.nav(game, true); + Progress.done(); + }); } }, @@ -78,9 +85,13 @@ export default Vue.extend({ }, methods: { - onGo(game) { + nav(game, silent) { this.matching = null; this.game = game; + + if (!silent) { + this.$emit('nav', this.game); + } }, onMatching(user) { -- cgit v1.2.3-freya