From 267925ce5a1263c97649a730cc7214e05fff35b8 Mon Sep 17 00:00:00 2001 From: neverclear86 Date: Fri, 12 Apr 2019 13:16:58 +0900 Subject: [PATCH] ver0.2.2 --- README.md | 2 -- package.json | 2 +- src/store.ts | 15 +++++++++------ src/views/Setting.vue | 28 ++++++++++++++-------------- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index ea8b402..f579522 100644 --- a/README.md +++ b/README.md @@ -7,5 +7,3 @@ ## 使い方 - 見た感じで操作できます -- 非アクティブでも`Ctrl+Shift+上``Ctrl+Shift+下`で操作できます -- `Ctrl+Shift+右`で正解数0にリセット diff --git a/package.json b/package.json index 97522e2..2bb4cf8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "quiz-stream-ui", - "version": "0.2.1", + "version": "0.2.2", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/src/store.ts b/src/store.ts index ddd8537..f4ce9a6 100644 --- a/src/store.ts +++ b/src/store.ts @@ -60,14 +60,17 @@ export default new Vuex.Store({ self.dev = isDev }, - setShortcutUp(self, {newKey, oldKey}: {newKey: string, oldKey: string}) { - registerShortcut(OperateAnswer.addAnswer, newKey, oldKey) + setShortcutUp(self, newKey: string) { + registerShortcut(OperateAnswer.addAnswer, newKey, self.shortcutUp) + self.shortcutUp = newKey }, - setShortcutDown(self, {newKey, oldKey}: {newKey: string, oldKey: string}) { - registerShortcut(OperateAnswer.subAnswer, newKey, oldKey) + setShortcutDown(self, newKey: string) { + registerShortcut(OperateAnswer.subAnswer, newKey, self.shortcutDown) + self.shortcutDown = newKey }, - setShortcutReset(self, {newKey, oldKey}: {newKey: string, oldKey: string}) { - registerShortcut(OperateAnswer.setAnswer, newKey, oldKey) + setShortcutReset(self, newKey: string) { + registerShortcut(OperateAnswer.setAnswer, newKey, self.shortcutReset) + self.shortcutReset = newKey }, }, plugins: [ diff --git a/src/views/Setting.vue b/src/views/Setting.vue index ac83e71..1fe33a4 100644 --- a/src/views/Setting.vue +++ b/src/views/Setting.vue @@ -20,11 +20,20 @@ v-flex(xs3) v-switch(v-model="textColor" :label="`文字カラー: ${textColor && '白' || '黒'}`") v-flex(xs4) - v-text-field(v-model="shortcutUp" label="正解数増ショートカット") + v-text-field(v-model="shortcutUp" label="正解数増ショートカット" append-icon="done" + @click:append="changeShortcut('setShortcutUp', shortcutUp)" + @change="changeShortcut('setShortcutUp', shortcutUp)" + ) v-flex(xs4) - v-text-field(v-model="shortcutDown" label="正解数減ショートカット") + v-text-field(v-model="shortcutDown" label="正解数減ショートカット" append-icon="done" + @click:append="changeShortcut('setShortcutDown', shortcutDown)" + @change="changeShortcut('setShortcutDown', shortcutDown)" + ) v-flex(xs4) - v-text-field(v-model="shortcutReset" label="正解数リセットショートカット") + v-text-field(v-model="shortcutReset" label="正解数リセットショートカット" append-icon="done" + @click:append="changeShortcut('setShortcutReset', shortcutReset)" + @change="changeShortcut('setShortcutReset', shortcutReset)" + ) @@ -75,17 +84,8 @@ this.send('setTextColor', color) } - @Watch('shortcutUp') - private changeUp(newKey: string, oldKey: string) { - this.send('setShortcutUp', {newKey, oldKey}) - } - @Watch('shortcutDown') - private changeDown(newKey: string, oldKey: string) { - this.send('setShortcutDown', {newKey, oldKey}) - } - @Watch('shortcutReset') - private changeReset(newKey: string, oldKey: string) { - this.send('setShortcutReset', {newKey, oldKey}) + private changeShortcut(ope: string, newKey: string) { + this.send(ope, newKey) } }