From 4858bd1552433bccf65fe219360631065b6b36eb Mon Sep 17 00:00:00 2001 From: Masafumi Yokoyama Date: Sun, 3 May 2020 05:40:08 +0900 Subject: [PATCH] add promote button ref: #9 --- components/Shogiboard.vue | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/components/Shogiboard.vue b/components/Shogiboard.vue index 130649f..333e7a1 100644 --- a/components/Shogiboard.vue +++ b/components/Shogiboard.vue @@ -36,19 +36,24 @@ v-bind:is-before-hand="isBeforeHand" >
-

SFEN:

+

+

SFEN:

@@ -267,6 +272,12 @@ export default Vue.extend({ this.$emit('updateText', this.buildSfen()) this.$emit('send') }, + togglePromotedAndTurnOnButton() { + if (this.beforeX === undefined) { + return + } + this.togglePromotedAndTurn(this.beforeX, this.beforeY) + }, moveCell(x, y) { if (this.beforeX === undefined && this.rows[y][x] !== ".") { this.beforeX = x