!177 修复useTable在total为0时的bug

Merge pull request !177 from nullcache/bug/add-fix-useTable
This commit is contained in:
芋道源码 2023-07-02 12:40:04 +00:00 committed by Gitee
commit c0bf357d7a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

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 = {}) => {