|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<el-main class="layout-main">
|
|
|
- <el-scrollbar class="layout-scrollbar" ref="layoutScrollbarRef" :style="{ padding: currentRoutemeta?.isLink && currentRouteMeta.isIframe ? 0 : '', transition: 'padding 0.3s ease-in-out' }">
|
|
|
- <LayoutParentView :style="{ minHeight: `calc(100vh - ${headerHeight})` }" />
|
|
|
+ <el-scrollbar class="layout-scrollbar" ref="layoutScrollbarRef" :style="{ padding: currentRouteMeta?.isLink && currentRouteMeta.isIframe ? 0 : '', transition: 'padding 0.3s ease-in-out' }">
|
|
|
+ <LayoutParentView :style="{ height: `calc(100vh - ${headerHeight})` }" />
|
|
|
<Footer v-if="getThemeConfig.isFooter" />
|
|
|
</el-scrollbar>
|
|
|
</el-main>
|
|
@@ -24,7 +24,7 @@ export default defineComponent({
|
|
|
name: 'layoutMain',
|
|
|
components: { LayoutParentView, Footer },
|
|
|
setup() {
|
|
|
- const { proxy } = <any>getCurrentInstance();
|
|
|
+ const { proxy } = getCurrentInstance() as any;
|
|
|
const route = useRoute();
|
|
|
const store = useStore();
|
|
|
const state = reactive<MainState>({
|
|
@@ -37,7 +37,7 @@ export default defineComponent({
|
|
|
});
|
|
|
// 设置 main 的高度
|
|
|
const initHeaderHeight = () => {
|
|
|
- const bool = state.currentRoutemeta?.isLink && state.currentRouteMeta.isIframe;
|
|
|
+ const bool = state.currentRouteMeta?.isLink && state.currentRouteMeta.isIframe;
|
|
|
let { isTagsview } = store.state.themeConfig.themeConfig;
|
|
|
if (isTagsview) return (state.headerHeight = bool ? `85px` : `114px`);
|
|
|
else return (state.headerHeight = `51px`);
|
|
@@ -56,7 +56,7 @@ export default defineComponent({
|
|
|
() => route.path,
|
|
|
() => {
|
|
|
state.currentRouteMeta = route.meta;
|
|
|
- const bool = state.currentRoutemeta?.isLink && state.currentRouteMeta.isIframe;
|
|
|
+ const bool = state.currentRouteMeta?.isLink && state.currentRouteMeta.isIframe;
|
|
|
state.headerHeight = bool ? `85px` : `114px`;
|
|
|
proxy.$refs.layoutScrollbarRef.update();
|
|
|
}
|
|
@@ -64,7 +64,7 @@ export default defineComponent({
|
|
|
// 监听 themeConfig 配置文件的变化,更新菜单 el-scrollbar 的高度
|
|
|
watch(store.state.themeConfig.themeConfig, (val) => {
|
|
|
state.currentRouteMeta = route.meta;
|
|
|
- const bool = state.currentRoutemeta?.isLink && state.currentRouteMeta.isIframe;
|
|
|
+ const bool = state.currentRouteMeta?.isLink && state.currentRouteMeta.isIframe;
|
|
|
state.headerHeight = val.isTagsview ? (bool ? `85px` : `114px`) : '51px';
|
|
|
if (val.isFixedHeaderChange !== val.isFixedHeader) {
|
|
|
if (!proxy.$refs.layoutScrollbarRef) return false;
|