ダークモードのキーボードショートカット追加

This commit is contained in:
syuilo
2018-09-23 07:59:48 +09:00
parent 28cb9cae51
commit 8028c85c67
2 changed files with 11 additions and 2 deletions

View File

@ -10,7 +10,8 @@ export default Vue.extend({
computed: {
keymap(): any {
return {
'h|slash': this.help
'h|slash': this.help,
'd': this.dark
};
}
},
@ -18,6 +19,13 @@ export default Vue.extend({
methods: {
help() {
window.open(`${url}/docs/${lang}/keyboard-shortcut`, '_blank');
},
dark() {
this.$store.commit('device/set', {
key: 'darkmode',
value: !this.$store.state.device.darkmode
});
}
}
});