Showing
2 changed files
with
7 additions
and
4 deletions
| @@ -88,7 +88,7 @@ export function useTableScroll( | @@ -88,7 +88,7 @@ export function useTableScroll( | ||
| 88 | 88 | ||
| 89 | bodyEl!.style.height = 'unset'; | 89 | bodyEl!.style.height = 'unset'; |
| 90 | 90 | ||
| 91 | - if (!unref(getCanResize) || tableData.length === 0) return; | 91 | + if (!unref(getCanResize)) return; |
| 92 | 92 | ||
| 93 | await nextTick(); | 93 | await nextTick(); |
| 94 | //Add a delay to get the correct bottomIncludeBody paginationHeight footerHeight headerHeight | 94 | //Add a delay to get the correct bottomIncludeBody paginationHeight footerHeight headerHeight |
| @@ -143,7 +143,12 @@ export function useTableScroll( | @@ -143,7 +143,12 @@ export function useTableScroll( | ||
| 143 | height = (height > maxHeight! ? (maxHeight as number) : height) ?? height; | 143 | height = (height > maxHeight! ? (maxHeight as number) : height) ?? height; |
| 144 | setHeight(height); | 144 | setHeight(height); |
| 145 | 145 | ||
| 146 | - bodyEl!.style.height = `${height}px`; | 146 | + if (tableData.length) { |
| 147 | + bodyEl!.style.height = `${height}px`; | ||
| 148 | + } else { | ||
| 149 | + const emptyPlaceholder: HTMLDivElement = tableEl.querySelector('.ant-table-placeholder')!; | ||
| 150 | + emptyPlaceholder && (emptyPlaceholder.style.height = `${height}px`); | ||
| 151 | + } | ||
| 147 | } | 152 | } |
| 148 | useWindowSizeFn(calcTableHeight, 280); | 153 | useWindowSizeFn(calcTableHeight, 280); |
| 149 | onMountedOrActivated(() => { | 154 | onMountedOrActivated(() => { |