Sharkey/src/client/app/app.vue

32 lines
545 B
Vue
Raw Normal View History

2018-02-09 17:52:26 -08:00
<template>
2018-09-18 16:36:06 -07:00
<router-view id="app" v-hotkey.global="keymap"></router-view>
2018-02-09 17:52:26 -08:00
</template>
2018-09-18 16:36:06 -07:00
<script lang="ts">
import Vue from 'vue';
import { url, lang } from './config';
2018-09-26 02:59:37 -07:00
import applyTheme from './common/scripts/theme';
2018-09-26 03:14:11 -07:00
const darkTheme = require('../theme/dark');
2018-09-18 16:36:06 -07:00
export default Vue.extend({
computed: {
keymap(): any {
return {
'h|slash': this.help,
'd': this.dark
2018-09-18 16:36:06 -07:00
};
}
},
methods: {
help() {
window.open(`${url}/docs/${lang}/keyboard-shortcut`, '_blank');
},
dark() {
2018-09-26 02:59:37 -07:00
applyTheme(darkTheme);
2018-09-18 16:36:06 -07:00
}
}
});
</script>