Merge pull request #154 from cshaptx4869/patch-100

fix: 🐛 修复移动端切换顶部布局模式时的遮罩问题
This commit is contained in:
Ray Hao
2024-07-05 11:46:49 +08:00
committed by GitHub
3 changed files with 6 additions and 6 deletions

View File

@@ -96,8 +96,6 @@ function changeLayout(layout: string) {
settingsStore.changeLayout(layout);
if (layout === LayoutEnum.MIX) {
route.name && againActiveTop(route.name as string);
} else if (layout === LayoutEnum.TOP) {
appStore.openSideBar();
}
}

View File

@@ -8,14 +8,13 @@
:active-text-color="variables['menu-active-text']"
:unique-opened="false"
:collapse-transition="false"
:mode="layout === 'top' ? 'horizontal' : 'vertical'"
:mode="mode"
>
<SidebarMenuItem
v-for="route in menuList"
:key="route.path"
:item="route"
:base-path="resolvePath(route.path)"
:is-collapse="!appStore.sidebar.opened"
/>
</el-menu>
</template>
@@ -25,11 +24,11 @@ import { useSettingsStore, useAppStore } from "@/store";
import { isExternal } from "@/utils/index";
import path from "path-browserify";
import variables from "@/styles/variables.module.scss";
import { LayoutEnum } from "@/enums/LayoutEnum";
const settingsStore = useSettingsStore();
const appStore = useAppStore();
const currentRoute = useRoute();
const layout = computed(() => settingsStore.layout);
const props = defineProps({
menuList: {
required: true,
@@ -43,6 +42,9 @@ const props = defineProps({
required: true,
},
});
const mode = computed(() => {
return settingsStore.layout === LayoutEnum.TOP ? "horizontal" : "vertical";
});
/**
* 解析路径

View File

@@ -38,7 +38,7 @@
<!-- 左侧和顶部布局 -->
<div v-else :class="{ hasTagsView: showTagsView }" class="main-container">
<div :class="{ 'fixed-header': fixedHeader }">
<NavBar v-if="layout === 'left'" />
<NavBar v-if="layout === LayoutEnum.LEFT" />
<TagsView v-if="showTagsView" />
</div>
<AppMain />