瀏覽代碼

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
       ? {