mirror of
https://github.com/chansee97/nova-admin.git
synced 2025-10-04 07:39:59 +08:00
fix: full content error
This commit is contained in:
parent
4e08b796c0
commit
1b4639d5d8
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "nova-admin",
|
||||
"type": "module",
|
||||
"version": "0.9.15",
|
||||
"version": "0.9.17",
|
||||
"private": true,
|
||||
"description": "a clean and concise back-end management template based on Vue3, Vite5, Typescript, and Naive UI.",
|
||||
"author": {
|
||||
|
@ -2,16 +2,49 @@
|
||||
import { useAppStore } from '@/store'
|
||||
|
||||
const appStore = useAppStore()
|
||||
|
||||
let previousLayoutMode = appStore.layoutMode
|
||||
|
||||
function enterFullContent() {
|
||||
previousLayoutMode = appStore.layoutMode
|
||||
appStore.layoutMode = 'full-content'
|
||||
}
|
||||
|
||||
function exitFullContent() {
|
||||
// 如果是全屏或者数据不存在,则恢复为默认的vertical
|
||||
if (previousLayoutMode === 'full-content' || !previousLayoutMode) {
|
||||
previousLayoutMode = 'vertical'
|
||||
}
|
||||
appStore.layoutMode = previousLayoutMode
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-tooltip placement="bottom" trigger="hover">
|
||||
<template #trigger>
|
||||
<CommonWrapper @click="appStore.contentFullScreen = !appStore.contentFullScreen">
|
||||
<icon-park-outline-off-screen-one v-if="appStore.contentFullScreen" />
|
||||
<icon-park-outline-full-screen-one v-else />
|
||||
<CommonWrapper @click="enterFullContent">
|
||||
<icon-park-outline-full-screen-one />
|
||||
</CommonWrapper>
|
||||
</template>
|
||||
<span>{{ $t('app.togglContentFullScreen') }}</span>
|
||||
{{ $t('app.togglContentFullScreen') }}
|
||||
</n-tooltip>
|
||||
|
||||
<Teleport to="body">
|
||||
<div
|
||||
v-if="appStore.layoutMode === 'full-content'"
|
||||
class="fixed top-4 right-0 z-[9999]"
|
||||
>
|
||||
<n-tooltip placement="left" trigger="hover">
|
||||
<template #trigger>
|
||||
<n-el
|
||||
class="bg-[var(--primary-color)] c-[var(--base-color)] rounded-l-lg shadow-lg p-2 cursor-pointer"
|
||||
@click="exitFullContent"
|
||||
>
|
||||
<icon-park-outline-off-screen-one />
|
||||
</n-el>
|
||||
</template>
|
||||
{{ $t('app.togglContentFullScreen') }}
|
||||
</n-tooltip>
|
||||
</div>
|
||||
</Teleport>
|
||||
</template>
|
||||
|
@ -38,7 +38,6 @@ export const useAppStore = defineStore('app-store', {
|
||||
showSetting: false,
|
||||
transitionAnimation: 'fade-slide' as TransitionAnimation,
|
||||
layoutMode: 'vertical' as ProLayoutMode,
|
||||
contentFullScreen: false,
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
@ -68,8 +67,7 @@ export const useAppStore = defineStore('app-store', {
|
||||
this.showBreadcrumbIcon = true
|
||||
this.showWatermark = false
|
||||
this.transitionAnimation = 'fade-slide'
|
||||
this.layoutMode = 'leftMenu'
|
||||
this.contentFullScreen = false
|
||||
this.layoutMode = 'vertical'
|
||||
|
||||
// 重置所有配色
|
||||
this.setPrimaryColor(this.primaryColor)
|
||||
|
Loading…
x
Reference in New Issue
Block a user