fix(table): ensure that the height calculation is correct close #395

This commit is contained in:
Vben
2021-03-20 17:06:16 +08:00
parent 7c16c2fa9e
commit 1d7608ee40
5 changed files with 37 additions and 30 deletions

View File

@@ -87,7 +87,6 @@ export function useTableScroll(
// Table height from bottom height-custom offset
const paddingHeight = 32;
const borderHeight = 0;
// Pager height
let paginationHeight = 2;
if (!isBoolean(pagination)) {
@@ -99,6 +98,8 @@ export function useTableScroll(
// TODO First fix 24
paginationHeight += 24;
}
} else {
paginationHeight = -8;
}
let footerHeight = 0;
@@ -120,7 +121,6 @@ export function useTableScroll(
bottomIncludeBody -
(resizeHeightOffset || 0) -
paddingHeight -
borderHeight -
paginationHeight -
footerHeight -
headerHeight;

View File

@@ -35,7 +35,7 @@
}
.ant-table-wrapper {
padding: 8px;
padding: 6px;
background: #fff;
border-radius: 2px;

View File

@@ -1,29 +1,27 @@
<template>
<div>
<RouterView>
<template #default="{ Component, route }">
<transition
:name="
getTransitionName({
route,
openCache,
enableTransition: getEnableTransition,
cacheTabs: getCaches,
def: getBasicTransition,
})
"
mode="out-in"
appear
>
<keep-alive v-if="openCache" :include="getCaches">
<component :is="Component" :key="route.fullPath" />
</keep-alive>
<component v-else :is="Component" :key="route.fullPath" />
</transition>
</template>
</RouterView>
<FrameLayout v-if="getCanEmbedIFramePage" />
</div>
<RouterView>
<template #default="{ Component, route }">
<transition
:name="
getTransitionName({
route,
openCache,
enableTransition: getEnableTransition,
cacheTabs: getCaches,
def: getBasicTransition,
})
"
mode="out-in"
appear
>
<keep-alive v-if="openCache" :include="getCaches">
<component :is="Component" :key="route.fullPath" />
</keep-alive>
<component v-else :is="Component" :key="route.fullPath" />
</transition>
</template>
</RouterView>
<FrameLayout v-if="getCanEmbedIFramePage" />
</template>
<script lang="ts">