소스 검색

fix(table): index column value error #187

vben 4 년 전
부모
커밋
056fc13116
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      src/components/Table/src/hooks/useColumns.ts

+ 1 - 2
src/components/Table/src/hooks/useColumns.ts

@@ -73,8 +73,7 @@ function handleIndexColumn(
         return `${index + 1}`;
       }
       const { current = 1, pageSize = PAGE_SIZE } = getPagination;
-      const currentIndex = (current - 1) * pageSize + index + 1;
-      return currentIndex;
+      return ((current < 1 ? 1 : current) - 1) * pageSize + index + 1;
     },
     ...(isFixedLeft
       ? {