Skip to content

Commit

Permalink
ver0.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
neverclear86 committed Apr 12, 2019
1 parent c6c8ac5 commit 267925c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@

## 使い方
- 見た感じで操作できます
- 非アクティブでも`Ctrl+Shift+上``Ctrl+Shift+下`で操作できます
- `Ctrl+Shift+右`で正解数0にリセット
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "quiz-stream-ui",
"version": "0.2.1",
"version": "0.2.2",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
15 changes: 9 additions & 6 deletions src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
28 changes: 14 additions & 14 deletions src/views/Setting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
)

</template>

Expand Down Expand Up @@ -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)
}
}
</script>
Expand Down

0 comments on commit 267925c

Please sign in to comment.