Commit ddc3786b168a2931200ef61cc68dd80a18d714cc

Authored by vben
1 parent b8353fe1

fix: fix table auto height

src/components/Table/src/hooks/useTableScroll.ts
... ... @@ -77,7 +77,7 @@ export function useTableScroll(refProps: ComputedRef<BasicTableProps>, tableElRe
77 77 if (el) {
78 78 headerHeight = (el as HTMLElement).offsetHeight;
79 79 }
80   - const tHeight =
  80 + tableHeightRef.value =
81 81 bottomIncludeBody -
82 82 (resizeHeightOffset || 0) -
83 83 paddingHeight -
... ... @@ -86,7 +86,8 @@ export function useTableScroll(refProps: ComputedRef<BasicTableProps>, tableElRe
86 86 footerHeight -
87 87 headerHeight;
88 88 useTimeout(() => {
89   - tableHeightRef.value = tHeight > maxHeight! ? (maxHeight as number) : tableHeightRef.value;
  89 + tableHeightRef.value =
  90 + tableHeightRef.value! > maxHeight! ? (maxHeight as number) : tableHeightRef.value;
90 91 cb && cb();
91 92 }, 0);
92 93 }
... ...