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,7 +77,7 @@ export function useTableScroll(refProps: ComputedRef<BasicTableProps>, tableElRe
77 if (el) { 77 if (el) {
78 headerHeight = (el as HTMLElement).offsetHeight; 78 headerHeight = (el as HTMLElement).offsetHeight;
79 } 79 }
80 - const tHeight = 80 + tableHeightRef.value =
81 bottomIncludeBody - 81 bottomIncludeBody -
82 (resizeHeightOffset || 0) - 82 (resizeHeightOffset || 0) -
83 paddingHeight - 83 paddingHeight -
@@ -86,7 +86,8 @@ export function useTableScroll(refProps: ComputedRef<BasicTableProps>, tableElRe @@ -86,7 +86,8 @@ export function useTableScroll(refProps: ComputedRef<BasicTableProps>, tableElRe
86 footerHeight - 86 footerHeight -
87 headerHeight; 87 headerHeight;
88 useTimeout(() => { 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 cb && cb(); 91 cb && cb();
91 }, 0); 92 }, 0);
92 } 93 }