8
8
GLOBAL_OPTIONS_PROVIDE_KEY ,
9
9
} from './core/config' ;
10
10
import useAsyncQuery , { BaseResult } from './core/useAsyncQuery' ;
11
- import merge from 'lodash/merge ' ;
12
- import get from 'lodash/get ' ;
11
+ import { merge } from './core/utils/lodash ' ;
12
+ import { get } from './core/utils ' ;
13
13
import generateService from './core/utils/generateService' ;
14
14
import { IService } from './core/utils/types' ;
15
15
@@ -87,7 +87,7 @@ function usePagination<R, P extends unknown[], FR>(
87
87
{ pagination : getGlobalOptions ( ) . pagination ?? { } } ,
88
88
{ pagination : injectedGlobalOptions . pagination ?? { } } ,
89
89
options ?? ( { } as any ) ,
90
- ) ;
90
+ ) as any ;
91
91
92
92
if ( queryKey ) {
93
93
throw new Error ( 'usePagination does not support concurrent request' ) ;
@@ -103,7 +103,7 @@ function usePagination<R, P extends unknown[], FR>(
103
103
] ,
104
104
} ,
105
105
restOptions ,
106
- ) ;
106
+ ) as any ;
107
107
108
108
const { data, params, queries, run, reset, ...rest } = useAsyncQuery <
109
109
R ,
@@ -147,7 +147,7 @@ function usePagination<R, P extends unknown[], FR>(
147
147
}
148
148
} ;
149
149
150
- const total = computed < number > ( ( ) => get ( data . value , totalKey , 0 ) ) ;
150
+ const total = computed < number > ( ( ) => get ( data . value ! , totalKey , 0 ) ) ;
151
151
const current = computed ( {
152
152
get : ( ) =>
153
153
( params . value [ 0 ] as Record < string , number > ) ?. [ currentKey ] ??
@@ -165,7 +165,7 @@ function usePagination<R, P extends unknown[], FR>(
165
165
} ,
166
166
} ) ;
167
167
const totalPage = computed < number > ( ( ) =>
168
- get ( data . value , totalPageKey , Math . ceil ( total . value / pageSize . value ) ) ,
168
+ get ( data . value ! , totalPageKey , Math . ceil ( total . value / pageSize . value ) ) ,
169
169
) ;
170
170
171
171
return {
0 commit comments