kn-hooks 0.0.36 → 0.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kn-hooks",
3
- "version": "0.0.36",
3
+ "version": "0.0.39",
4
4
  "scripts": {
5
5
  "dev": "cross-env env_api=dev env_package=dev webpack-dev-server --progress",
6
6
  "build": "cross-env env_api=prod env_package=prod webpack --config webpack.config.js",
@@ -146,16 +146,17 @@ const usePagination=(props)=>{
146
146
  let response={};
147
147
  if(req?.code==0){
148
148
  let {page:{current,total},data:reqData} = req;
149
+ let _pageSize=pageSize;
149
150
  // 兼容没数据的时候如果pageSize为0会导致接下来刷新的时候也按0的pageSize来写入
150
151
  if(req?.page?.pageSize){
151
- pageSize=+pageSize;
152
+ _pageSize=+req?.page?.pageSize;
152
153
  }
153
154
  current=+current;
154
155
  total=+total;
155
- const startIdx= (current-1)*pageSize;
156
- const more = current*pageSize<total;
156
+ const startIdx= (current-1)*_pageSize;
157
+ const more = current*_pageSize<total;
157
158
  response.pagination={
158
- current,pageSize,total,startIdx,more
159
+ current,pageSize:_pageSize,total,startIdx,more
159
160
  };
160
161
  setPagination(response.pagination);
161
162
  response.data= clear?[]:(data||[]);