vben
2023-04-05 8e5a6b7ce547ba8edb1d767bb4d820f3b66ff95a
src/components/Table/src/hooks/useTableScroll.ts
@@ -1,11 +1,10 @@
import type { BasicTableProps, TableRowSelection, BasicColumn } from '../types/table';
import { Ref, ComputedRef, ref } from 'vue';
import { computed, unref, nextTick, watch } from 'vue';
import { Ref, ComputedRef, ref, computed, unref, nextTick, watch } from 'vue';
import { getViewportOffset } from '/@/utils/domUtils';
import { isBoolean } from '/@/utils/is';
import { useWindowSizeFn } from '/@/hooks/event/useWindowSizeFn';
import { useModalContext } from '/@/components/Modal';
import { onMountedOrActivated } from '/@/hooks/core/onMountedOrActivated';
import { onMountedOrActivated } from '@vben/hooks';
import { useDebounceFn } from '@vueuse/core';
export function useTableScroll(
@@ -90,7 +89,7 @@
    bodyEl!.style.height = 'unset';
    if (!unref(getCanResize) || tableData.length === 0) return;
    if (!unref(getCanResize) || !unref(tableData) || tableData.length === 0) return;
    await nextTick();
    // Add a delay to get the correct bottomIncludeBody paginationHeight footerHeight headerHeight
@@ -191,7 +190,7 @@
    const columns = unref(columnsRef).filter((item) => !item.defaultHidden);
    columns.forEach((item) => {
      width += Number.parseInt(item.width as string) || 0;
      width += Number.parseFloat(item.width as string) || 0;
    });
    const unsetWidthColumns = columns.filter((item) => !Reflect.has(item, 'width'));