Merge pull request #154 from cshaptx4869/patch-100
fix: 🐛 修复移动端切换顶部布局模式时的遮罩问题
This commit is contained in:
@@ -96,8 +96,6 @@ function changeLayout(layout: string) {
|
|||||||
settingsStore.changeLayout(layout);
|
settingsStore.changeLayout(layout);
|
||||||
if (layout === LayoutEnum.MIX) {
|
if (layout === LayoutEnum.MIX) {
|
||||||
route.name && againActiveTop(route.name as string);
|
route.name && againActiveTop(route.name as string);
|
||||||
} else if (layout === LayoutEnum.TOP) {
|
|
||||||
appStore.openSideBar();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,14 +8,13 @@
|
|||||||
:active-text-color="variables['menu-active-text']"
|
:active-text-color="variables['menu-active-text']"
|
||||||
:unique-opened="false"
|
:unique-opened="false"
|
||||||
:collapse-transition="false"
|
:collapse-transition="false"
|
||||||
:mode="layout === 'top' ? 'horizontal' : 'vertical'"
|
:mode="mode"
|
||||||
>
|
>
|
||||||
<SidebarMenuItem
|
<SidebarMenuItem
|
||||||
v-for="route in menuList"
|
v-for="route in menuList"
|
||||||
:key="route.path"
|
:key="route.path"
|
||||||
:item="route"
|
:item="route"
|
||||||
:base-path="resolvePath(route.path)"
|
:base-path="resolvePath(route.path)"
|
||||||
:is-collapse="!appStore.sidebar.opened"
|
|
||||||
/>
|
/>
|
||||||
</el-menu>
|
</el-menu>
|
||||||
</template>
|
</template>
|
||||||
@@ -25,11 +24,11 @@ import { useSettingsStore, useAppStore } from "@/store";
|
|||||||
import { isExternal } from "@/utils/index";
|
import { isExternal } from "@/utils/index";
|
||||||
import path from "path-browserify";
|
import path from "path-browserify";
|
||||||
import variables from "@/styles/variables.module.scss";
|
import variables from "@/styles/variables.module.scss";
|
||||||
|
import { LayoutEnum } from "@/enums/LayoutEnum";
|
||||||
|
|
||||||
const settingsStore = useSettingsStore();
|
const settingsStore = useSettingsStore();
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const currentRoute = useRoute();
|
const currentRoute = useRoute();
|
||||||
const layout = computed(() => settingsStore.layout);
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
menuList: {
|
menuList: {
|
||||||
required: true,
|
required: true,
|
||||||
@@ -43,6 +42,9 @@ const props = defineProps({
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const mode = computed(() => {
|
||||||
|
return settingsStore.layout === LayoutEnum.TOP ? "horizontal" : "vertical";
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 解析路径
|
* 解析路径
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<!-- 左侧和顶部布局 -->
|
<!-- 左侧和顶部布局 -->
|
||||||
<div v-else :class="{ hasTagsView: showTagsView }" class="main-container">
|
<div v-else :class="{ hasTagsView: showTagsView }" class="main-container">
|
||||||
<div :class="{ 'fixed-header': fixedHeader }">
|
<div :class="{ 'fixed-header': fixedHeader }">
|
||||||
<NavBar v-if="layout === 'left'" />
|
<NavBar v-if="layout === LayoutEnum.LEFT" />
|
||||||
<TagsView v-if="showTagsView" />
|
<TagsView v-if="showTagsView" />
|
||||||
</div>
|
</div>
|
||||||
<AppMain />
|
<AppMain />
|
||||||
|
|||||||
Reference in New Issue
Block a user