fix: 修复内容区全屏时顶部存在的间隙以及部分模态框不能显示的问题
This commit is contained in:
parent
b7987218c0
commit
952b327261
@ -35,6 +35,8 @@ const handleFullscreenClick = () => {
|
|||||||
}
|
}
|
||||||
const handleFullscreenChange = () => {
|
const handleFullscreenChange = () => {
|
||||||
isFullscreen.value = screenfull.isFullscreen
|
isFullscreen.value = screenfull.isFullscreen
|
||||||
|
// 退出全屏时清除所有的 class
|
||||||
|
isFullscreen.value || (document.body.className = "")
|
||||||
}
|
}
|
||||||
watchEffect((onCleanup) => {
|
watchEffect((onCleanup) => {
|
||||||
// 挂载组件时自动执行
|
// 挂载组件时自动执行
|
||||||
@ -55,8 +57,17 @@ const contentLargeSvgName = computed(() => {
|
|||||||
return isContentLarge.value ? "fullscreen-exit" : "fullscreen"
|
return isContentLarge.value ? "fullscreen-exit" : "fullscreen"
|
||||||
})
|
})
|
||||||
const handleContentLargeClick = () => {
|
const handleContentLargeClick = () => {
|
||||||
document.body.className = !isContentLarge.value ? "content-large" : ""
|
|
||||||
isContentLarge.value = !isContentLarge.value
|
isContentLarge.value = !isContentLarge.value
|
||||||
|
// 内容区放大时,将不需要的组件隐藏
|
||||||
|
document.body.className = isContentLarge.value ? "content-large" : ""
|
||||||
|
}
|
||||||
|
const handleContentFullClick = () => {
|
||||||
|
// 取消内容区放大
|
||||||
|
isContentLarge.value && handleContentLargeClick()
|
||||||
|
// 内容区全屏时,将不需要的组件隐藏
|
||||||
|
document.body.className = "content-full"
|
||||||
|
// 开启全屏
|
||||||
|
handleFullscreenClick()
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
</script>
|
</script>
|
||||||
@ -68,14 +79,14 @@ const handleContentLargeClick = () => {
|
|||||||
<SvgIcon :name="fullscreenSvgName" @click="handleFullscreenClick" />
|
<SvgIcon :name="fullscreenSvgName" @click="handleFullscreenClick" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<!-- 内容区 -->
|
<!-- 内容区 -->
|
||||||
<el-dropdown v-else>
|
<el-dropdown v-else :disabled="isFullscreen">
|
||||||
<SvgIcon :name="contentLargeSvgName" />
|
<SvgIcon :name="contentLargeSvgName" />
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<!-- 内容区放大 -->
|
<!-- 内容区放大 -->
|
||||||
<el-dropdown-item @click="handleContentLargeClick">{{ contentLargeTips }}</el-dropdown-item>
|
<el-dropdown-item @click="handleContentLargeClick">{{ contentLargeTips }}</el-dropdown-item>
|
||||||
<!-- 内容区全屏 -->
|
<!-- 内容区全屏 -->
|
||||||
<el-dropdown-item @click="handleFullscreenClick" :disabled="isFullscreen">内容区全屏</el-dropdown-item>
|
<el-dropdown-item @click="handleContentFullClick">内容区全屏</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template>
|
</template>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
|
@ -114,7 +114,7 @@ listenerRouteChange(() => {
|
|||||||
<el-icon class="arrow right" @click="scrollTo('right')">
|
<el-icon class="arrow right" @click="scrollTo('right')">
|
||||||
<ArrowRight />
|
<ArrowRight />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<Screenfull v-if="settingsStore.showScreenfull" element=".app-main" :content="true" class="screenfull" />
|
<Screenfull v-if="settingsStore.showScreenfull" :content="true" class="screenfull" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -196,6 +196,7 @@ onMounted(() => {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: var(--v3-header-bg-color);
|
background-color: var(--v3-header-bg-color);
|
||||||
box-shadow: 0 0 3px 0 #00000010;
|
box-shadow: 0 0 3px 0 #00000010;
|
||||||
|
overflow: hidden;
|
||||||
.tags-view-wrapper {
|
.tags-view-wrapper {
|
||||||
.tags-view-item {
|
.tags-view-item {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
@ -42,3 +42,16 @@ body.content-large {
|
|||||||
--v3-sidebar-width: 0px;
|
--v3-sidebar-width: 0px;
|
||||||
--v3-sidebar-hide-width: 0px;
|
--v3-sidebar-hide-width: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 内容区全屏时,将不需要的组件隐藏 */
|
||||||
|
body.content-full {
|
||||||
|
/** Header 区域 */
|
||||||
|
--v3-header-height: 0px;
|
||||||
|
/** NavigationBar 组件 */
|
||||||
|
--v3-navigationbar-height: 0px;
|
||||||
|
/** Sidebar 组件 */
|
||||||
|
--v3-sidebar-width: 0px;
|
||||||
|
--v3-sidebar-hide-width: 0px;
|
||||||
|
/** TagsView 组件 */
|
||||||
|
--v3-tagsview-height: 0px;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user