Skip to content

Commit 056fc13

Browse files
committedJan 14, 2021
fix(table): index column value error #187
1 parent 6d5c49f commit 056fc13

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎src/components/Table/src/hooks/useColumns.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ function handleIndexColumn(
7373
return `${index + 1}`;
7474
}
7575
const { current = 1, pageSize = PAGE_SIZE } = getPagination;
76-
const currentIndex = (current - 1) * pageSize + index + 1;
77-
return currentIndex;
76+
return ((current < 1 ? 1 : current) - 1) * pageSize + index + 1;
7877
},
7978
...(isFixedLeft
8079
? {

0 commit comments

Comments
 (0)