kn-hooks 0.0.35 → 0.0.36
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
|
@@ -145,9 +145,12 @@ const usePagination=(props)=>{
|
|
|
145
145
|
console.log('[usePagination] response',req)
|
|
146
146
|
let response={};
|
|
147
147
|
if(req?.code==0){
|
|
148
|
-
let {page:{current,
|
|
148
|
+
let {page:{current,total},data:reqData} = req;
|
|
149
|
+
// 兼容没数据的时候如果pageSize为0会导致接下来刷新的时候也按0的pageSize来写入
|
|
150
|
+
if(req?.page?.pageSize){
|
|
151
|
+
pageSize=+pageSize;
|
|
152
|
+
}
|
|
149
153
|
current=+current;
|
|
150
|
-
pageSize=+pageSize;
|
|
151
154
|
total=+total;
|
|
152
155
|
const startIdx= (current-1)*pageSize;
|
|
153
156
|
const more = current*pageSize<total;
|