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