-
-
Notifications
You must be signed in to change notification settings - Fork 941
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pagination): added for support
layout
on Pagination (#1533)
* refactor(pagination): replace `a` with button * feat(pagination): added for support `layout` on Pagination * fix(panel): fix: Property 'Pagination' does not exist on type 'Table' * feat(pagination): support router for PaginationButton * docs(pagination): update docs for pagination * docs(table): update example for table pagination
- Loading branch information
Showing
53 changed files
with
776 additions
and
652 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!--start-code--> | ||
|
||
```js | ||
const NavLink = React.forwardRef((props, ref) => { | ||
const { href, active, eventKey, as, ...rest } = props; | ||
return ( | ||
<Link | ||
href={`${location.pathname}?page=${eventKey}`} | ||
className={active ? 'active' : null} | ||
as={as} | ||
> | ||
<a ref={ref} {...rest} /> | ||
</Link> | ||
); | ||
}); | ||
|
||
const App = () => { | ||
const search = location.search.match(/\?page=(\d+)/); | ||
const activePage = search ? parseInt(search[1]) : 1; | ||
|
||
return <Pagination linkAs={NavLink} total={100} limit={10} activePage={activePage} />; | ||
}; | ||
ReactDOM.render(<App />); | ||
``` | ||
|
||
<!--end-code--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,31 @@ | ||
import React from 'react'; | ||
import { Pagination, Button, Toggle, Divider } from 'rsuite'; | ||
import { | ||
Pagination, | ||
Button, | ||
Toggle, | ||
Divider, | ||
Slider, | ||
SelectPicker, | ||
TagPicker, | ||
InputNumber | ||
} from 'rsuite'; | ||
import Link from 'next/link'; | ||
import DefaultPage from '@/components/Page'; | ||
|
||
export default function Page() { | ||
return <DefaultPage dependencies={{ Pagination, Button, Toggle, Divider }} />; | ||
return ( | ||
<DefaultPage | ||
dependencies={{ | ||
Link, | ||
Pagination, | ||
Button, | ||
Toggle, | ||
Divider, | ||
Slider, | ||
SelectPicker, | ||
TagPicker, | ||
InputNumber | ||
}} | ||
/> | ||
); | ||
} |
Oops, something went wrong.
9713cd5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
rsuite-next – ./
rsuite-next-rsuite.vercel.app
rsuite-next-git-next-rsuite.vercel.app
rsuite-next.vercel.app
next.rsuitejs.com
rsuite-next-git-next.rsuite.vercel.app
rsuite-next.rsuite.vercel.app