Skip to content

Commit

Permalink
fix(table): ensure that the height calculation is correct close #395
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Mar 20, 2021
1 parent 7c16c2f commit 1d7608e
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 30 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.zh_CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Wip

### ✨ Features

- 路由新增 hideChildrenInMenu 配置。用于隐藏子菜单

### ✨ Refactor

- 重构路由多层模式,解决嵌套 keepalive 执行多次问题
Expand All @@ -8,6 +12,11 @@

- 确保 CountDownInput 组件重置清空值
- 修复分割模式下在小屏幕中显示问题
- 修复表格高度计算问题
- 修复后台路由获取不到组件问题
- 修复 Modal 组件 loadingTip 配置不生效
- 修复后台权限指令不生效
- 确保 progress 进度条正确关闭

## 2.1.0 (2021-03-15)

Expand Down
4 changes: 2 additions & 2 deletions build/vite/plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { configThemePlugin } from './theme';
import { configImageminPlugin } from './imagemin';
import { configWindiCssPlugin } from './windicss';
import { configSvgIconsPlugin } from './svgSprite';
// import { configHmrPlugin } from './hmr';
import { configHmrPlugin } from './hmr';

export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
const { VITE_USE_IMAGEMIN, VITE_USE_MOCK, VITE_LEGACY, VITE_BUILD_COMPRESS } = viteEnv;
Expand All @@ -30,7 +30,7 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
];

// TODO
// !isBuild && vitePlugins.push(configHmrPlugin());
!isBuild && vitePlugins.push(configHmrPlugin());

// @vitejs/plugin-legacy
VITE_LEGACY && isBuild && vitePlugins.push(legacy());
Expand Down
4 changes: 2 additions & 2 deletions src/components/Table/src/hooks/useTableScroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -99,6 +98,8 @@ export function useTableScroll(
// TODO First fix 24
paginationHeight += 24;
}
} else {
paginationHeight = -8;
}

let footerHeight = 0;
Expand All @@ -120,7 +121,6 @@ export function useTableScroll(
bottomIncludeBody -
(resizeHeightOffset || 0) -
paddingHeight -
borderHeight -
paginationHeight -
footerHeight -
headerHeight;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/src/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}

.ant-table-wrapper {
padding: 8px;
padding: 6px;
background: #fff;
border-radius: 2px;

Expand Down
48 changes: 23 additions & 25 deletions src/layouts/page/index.vue
Original file line number Diff line number Diff line change
@@ -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">
Expand Down

0 comments on commit 1d7608e

Please sign in to comment.