Skip to content

Commit ab4346b

Browse files
committed
Add pagerCount props
1 parent 4b1c6b2 commit ab4346b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ React.render(<Pagination />, container);
7676
| nextIcon | specifict the default previous icon | ReactNode \| (props: PaginationProps) => ReactNode | |
7777
| jumpPrevIcon | specifict the default previous icon | ReactNode \| (props: PaginationProps) => ReactNode | |
7878
| jumpNextIcon | specifict the default previous icon | ReactNode \| (props: PaginationProps) => ReactNode | |
79-
79+
| hideBoundary | hide boundary jumper | Bool | false |
8080

8181
## License
8282

src/Pagination.jsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class Pagination extends React.Component {
5353
nextIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
5454
jumpPrevIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
5555
jumpNextIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
56+
hideBoundary: PropTypes.bool,
5657
};
5758

5859
static defaultProps = {
@@ -74,6 +75,7 @@ class Pagination extends React.Component {
7475
locale: LOCALE,
7576
style: {},
7677
itemRender: defaultItemRender,
78+
hideBoundary: false,
7779
};
7880

7981
constructor(props) {
@@ -569,10 +571,10 @@ class Pagination extends React.Component {
569571
pagerList.push(jumpNext);
570572
}
571573

572-
if (left !== 1) {
574+
if (left !== 1 && !props.hideBoundary) {
573575
pagerList.unshift(firstPager);
574576
}
575-
if (right !== allPages) {
577+
if (right !== allPages && !props.hideBoundary) {
576578
pagerList.push(lastPager);
577579
}
578580
}

0 commit comments

Comments
 (0)