修复useTable在total为0时的bug

This commit is contained in:
nullcache authored and Gitee committed 2023-06-27 04:06:01 +00:00
1 parent c1a4edf7b1
commit 073679875b
1 file changed
+1 -3
+1 -3
View File
@@ -136,9 +136,7 @@ export const useTable = <T = any>(config?: UseTableConfig<T>) => {
})
if (res) {
tableObject.tableList = (res as unknown as ResponseType).list
if ((res as unknown as ResponseType).total) {
tableObject.total = (res as unknown as ResponseType).total as unknown as number
}
tableObject.total = (res as unknown as ResponseType).total ?? 0
}
},
setProps: async (props: TableProps = {}) => {