2020-11-03 08:00:47 +00:00
|
|
|
<template>
|
|
|
|
<div class="mk-app" v-hotkey.global="keymap" :class="{ wallpaper }" @contextmenu.prevent="() => {}">
|
|
|
|
<XSidebar ref="nav" class="sidebar"/>
|
|
|
|
|
|
|
|
<XCommon/>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent } from 'vue';
|
|
|
|
import { host } from '@/config';
|
|
|
|
import { search } from '@/scripts/search';
|
|
|
|
import XCommon from './_common_/common.vue';
|
|
|
|
import * as os from '@/os';
|
|
|
|
import XSidebar from '@/components/sidebar.vue';
|
|
|
|
import { sidebarDef } from '@/sidebar';
|
2020-12-19 01:55:52 +00:00
|
|
|
import { ColdDeviceStorage } from '@/store';
|
2020-11-03 08:00:47 +00:00
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
|
|
|
XCommon,
|
|
|
|
XSidebar
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
host: host,
|
|
|
|
menuDef: sidebarDef,
|
|
|
|
wallpaper: localStorage.getItem('wallpaper') != null,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
keymap(): any {
|
|
|
|
return {
|
|
|
|
'd': () => {
|
2020-12-19 01:55:52 +00:00
|
|
|
if (ColdDeviceStorage.get('syncDeviceDarkMode')) return;
|
|
|
|
this.$store.set('darkMode', !this.$store.state.darkMode);
|
2020-11-03 08:00:47 +00:00
|
|
|
},
|
|
|
|
'p': os.post,
|
|
|
|
'n': os.post,
|
|
|
|
's': () => search(),
|
|
|
|
'h|/': this.help
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
menu(): string[] {
|
2020-12-19 01:55:52 +00:00
|
|
|
return this.$store.state.menu;
|
2020-11-03 08:00:47 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2020-11-08 04:39:36 +00:00
|
|
|
created() {
|
|
|
|
if (window.innerWidth < 1024) {
|
|
|
|
localStorage.setItem('ui', 'default');
|
|
|
|
location.reload();
|
|
|
|
}
|
|
|
|
},
|
2020-11-03 08:00:47 +00:00
|
|
|
|
|
|
|
methods: {
|
|
|
|
help() {
|
|
|
|
this.$router.push('/docs/keyboard-shortcut');
|
|
|
|
},
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.mk-app {
|
2020-11-03 08:04:37 +00:00
|
|
|
height: 100vh;
|
|
|
|
width: 100vw;
|
2020-11-03 08:00:47 +00:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
</style>
|