修复useTable在total为0时的bug

(cherry picked from commit 69c4995b52)
pull/185/head
nullcache 2023-06-27 11:54:59 +08:00 committed by shizhong
parent bc35b0c80f
commit 341dcaf665
1 changed files with 1 additions and 3 deletions

View File

@ -136,9 +136,7 @@ export const useTable = <T = any>(config?: UseTableConfig<T>) => {
}) })
if (res) { if (res) {
tableObject.tableList = (res as unknown as ResponseType).list tableObject.tableList = (res as unknown as ResponseType).list
if ((res as unknown as ResponseType).total) { tableObject.total = (res as unknown as ResponseType).total ?? 0
tableObject.total = (res as unknown as ResponseType).total as unknown as number
}
} }
}, },
setProps: async (props: TableProps = {}) => { setProps: async (props: TableProps = {}) => {