feat: 全屏

This commit is contained in:
wangdan 2023-02-09 15:12:13 +08:00 committed by wangdan-fit2cloud
parent 26535ebc09
commit eb9ec322f8
5 changed files with 11 additions and 2 deletions

View file

@ -1,9 +1,9 @@
<template>
<Layout v-loading="loading" :element-loading-text="loadinText" fullscreen>
<template #menu>
<template #menu v-if="!globalStore.isFullScreen">
<Menu></Menu>
</template>
<template #footer>
<template #footer v-if="!globalStore.isFullScreen">
<Footer></Footer>
</template>
</Layout>

View file

@ -12,6 +12,7 @@
@click="jump(key)"
:right="key == paths.length - 1"
>
<!-- <span class="sle">{{ item }}</span> -->
{{ item }}
</BreadCrumbItem>
</BreadCrumbs>

View file

@ -19,9 +19,13 @@ export const GlobalStore = defineStore({
theme: 'bright',
footer: true,
},
isFullScreen: false,
}),
getters: {},
actions: {
setScreenFull() {
this.isFullScreen = !this.isFullScreen;
},
setLogStatus(login: boolean) {
this.isLogin = login;
},

View file

@ -15,6 +15,7 @@ export interface GlobalState {
language: string; // zh | en
// assemblySize: string; // small | default | large
themeConfig: ThemeConfigProp;
isFullScreen: boolean;
}
export interface MenuState {

View file

@ -131,13 +131,16 @@ import i18n from '@/lang';
import { Host } from '@/api/interface/host';
import { getHostTree, testByID } from '@/api/modules/host';
import { getCommandList } from '@/api/modules/command';
import { GlobalStore } from '@/store';
const dialogRef = ref();
const ctx = getCurrentInstance() as any;
const globalStore = GlobalStore();
function toggleFullscreen() {
if (screenfull.isEnabled) {
screenfull.toggle();
globalStore.setScreenFull();
}
}