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