Skip to content

Commit 1d04323

Browse files
author
杨楠
committed
feat:Pagination 增加页码跳转功能 及 doc(website): Update Pagination Readme.md
1 parent d7db286 commit 1d04323

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

packages/core/src/Pagination/README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Pagination 分页器
33

44
用于展示页码、请求数据等。
55

6-
<img src='https://user-images.githubusercontent.com/66067296/139399708-239e65f9-565e-4be2-9497-c8e5b836cef6.png' alt='Pagination' style='zoom:33%;' />
6+
<img src='https://user-images.githubusercontent.com/66067296/140001996-ff0fe66c-0482-4576-9f19-11be3a6b7ada.png' alt='Pagination' style='zoom:33%;' />
77

88
### 基础示例
99

@@ -28,7 +28,7 @@ function Demo() {
2828
}
2929
```
3030

31-
### 使用icon && 修改大小 && 页码跳转
31+
### 使用icon && 修改大小
3232

3333
```jsx
3434
import { Fragment, useState } from 'react';
@@ -54,6 +54,30 @@ function Demo() {
5454
}
5555
```
5656

57+
### 页码跳转
58+
59+
```jsx
60+
import { Fragment, useState } from 'react';
61+
import { Pagination } from '@uiw/react-native';
62+
function Demo() {
63+
const [current, setCurrent] = useState(false)
64+
return (
65+
<Fragment>
66+
<Pagination
67+
current={current}
68+
total={60}
69+
pageSize={8}
70+
jumpBtn={true}
71+
onPageChange={(type, current) => {
72+
setCurrent(current)
73+
console.log('type, current: ', type, current);
74+
}}
75+
/>
76+
</Fragment>
77+
);
78+
}
79+
```
80+
5781
### Props
5882

5983
```ts

0 commit comments

Comments
 (0)