🙏 分页支持数据在服务端分页
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 220
- PR merge metrics
- No merged PRs in 30d
Description
### 🖋 Description
通过目前的源码分析,分页是全部数据给到 S2 ,然后在前端实现的分页。但是在服务端实现分页也是一个比较常见的情况,要增加这个特性的话,原则上只需要一个标志告知组件内部是否采用服务端分页方式,如果采用服务端分页,则对 `total` 的更新采用 `props` 传入,S2 也不在调用 `updatePagination`
### 🏞 What problem does this feature solve
支持数据在服务端分页,分页组件采用 S2-react 或 S2-Vue 的分页组件
### 🧐 Suggest the API
```js
pagination = {
current: Number,
pageSize: Number,
total: Number //feat
}
showPagination = {
onChange: Function,
onShowSizeChange: Function,
serverSide: Boolean // feat
}
```
| name | type | default | description |
|----|----|----|----|
| pagination.total | Number | 0 | 数据总条数 |
| showPagination .serverSide | Boolean | false | 是否服务端分页 |
Contributor guide
Research direction
Start by tracing the existing pagination flow described in the issue, especially where all data is passed to S2 and where updatePagination is called. Review the S2-react and S2-Vue pagination components and the proposed pagination and showPagination APIs; done means server-side mode uses the props-provided total and does not call updatePagination.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100