Procházet zdrojové kódy

修复useTable在total为0时的bug

nullcache před 1 rokem
rodič
revize
073679875b
1 změnil soubory, kde provedl 1 přidání a 3 odebrání
  1. 1 3
      src/hooks/web/useTable.ts

+ 1 - 3
src/hooks/web/useTable.ts

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