rudeshark.net/packages/client/src/ui/desktop.vue

71 lines
1.2 KiB
Vue
Raw Normal View History

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