rudeshark.net/src/client/app/app.vue

38 lines
667 B
Vue
Raw Normal View History

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