2020-11-03 00:00:47 -08:00
|
|
|
<template>
|
2020-12-27 00:04:41 -08:00
|
|
|
<div class="mk-app" :class="{ wallpaper }" @contextmenu.prevent="() => {}">
|
2020-11-03 00:00:47 -08:00
|
|
|
<XSidebar ref="nav" class="sidebar"/>
|
|
|
|
|
|
|
|
<XCommon/>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent } from 'vue';
|
2021-03-23 01:30:14 -07:00
|
|
|
import { host } from '@client/config';
|
|
|
|
import { search } from '@client/scripts/search';
|
2020-11-03 00:00:47 -08:00
|
|
|
import XCommon from './_common_/common.vue';
|
2021-03-23 01:30:14 -07:00
|
|
|
import * as os from '@client/os';
|
2021-04-09 20:40:50 -07:00
|
|
|
import XSidebar from '@client/ui/_common_/sidebar.vue';
|
2021-07-18 19:36:35 -07:00
|
|
|
import { menuDef } from '@client/menu';
|
2021-03-23 01:30:14 -07:00
|
|
|
import { ColdDeviceStorage } from '@client/store';
|
2020-11-03 00:00:47 -08:00
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
|
|
|
XCommon,
|
|
|
|
XSidebar
|
|
|
|
},
|
|
|
|
|
2020-12-27 01:13:50 -08:00
|
|
|
provide() {
|
|
|
|
return {
|
|
|
|
navHook: (url) => {
|
|
|
|
os.pageWindow(url);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
2020-11-03 00:00:47 -08:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
host: host,
|
2021-07-18 19:36:35 -07:00
|
|
|
menuDef: menuDef,
|
2020-11-03 00:00:47 -08:00
|
|
|
wallpaper: localStorage.getItem('wallpaper') != null,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
menu(): string[] {
|
2020-12-18 17:55:52 -08:00
|
|
|
return this.$store.state.menu;
|
2020-11-03 00:00:47 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2020-11-07 20:39:36 -08:00
|
|
|
created() {
|
|
|
|
if (window.innerWidth < 1024) {
|
|
|
|
localStorage.setItem('ui', 'default');
|
|
|
|
location.reload();
|
|
|
|
}
|
|
|
|
},
|
2020-11-03 00:00:47 -08:00
|
|
|
|
|
|
|
methods: {
|
|
|
|
help() {
|
|
|
|
this.$router.push('/docs/keyboard-shortcut');
|
|
|
|
},
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.mk-app {
|
2020-11-03 00:04:37 -08:00
|
|
|
height: 100vh;
|
|
|
|
width: 100vw;
|
2020-11-03 00:00:47 -08:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
</style>
|