yumechi-no-kuni/src/client/app/app.vue

33 lines
538 B
Vue
Raw Normal View History

2018-02-09 19:52:26 -06:00
<template>
2018-09-18 18:36:06 -05:00
<router-view id="app" v-hotkey.global="keymap"></router-view>
2018-02-09 19:52:26 -06:00
</template>
2018-09-18 18:36:06 -05:00
<script lang="ts">
import Vue from 'vue';
import { url, lang } from './config';
export default Vue.extend({
computed: {
keymap(): any {
return {
'h|slash': this.help,
2018-09-28 10:01:11 -05:00
'd': this.dark
2018-09-18 18:36:06 -05:00
};
}
},
methods: {
help() {
window.open(`${url}/docs/${lang}/keyboard-shortcut`, '_blank');
},
dark() {
2018-09-28 10:01:11 -05:00
this.$store.commit('device/set', {
key: 'darkmode',
value: !this.$store.state.device.darkmode
});
2018-09-18 18:36:06 -05:00
}
}
});
</script>