mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 21:55:11 +00:00
fix(nuxt): fix useLazyFetch types (#20989)
This commit is contained in:
parent
f13ccfe836
commit
bb28819d3c
@ -134,7 +134,7 @@ export function useLazyFetch<
|
|||||||
DefaultT = null,
|
DefaultT = null,
|
||||||
> (
|
> (
|
||||||
request: Ref<ReqT> | ReqT | (() => ReqT),
|
request: Ref<ReqT> | ReqT | (() => ReqT),
|
||||||
opts?: Omit<UseFetchOptions<_ResT, DataT, PickKeys, DefaultT, Method>, 'lazy'>
|
opts?: Omit<UseFetchOptions<_ResT, DataT, PickKeys, DefaultT, ReqT, Method>, 'lazy'>
|
||||||
): AsyncData<PickFrom<DataT, PickKeys> | DefaultT, ErrorT | null>
|
): AsyncData<PickFrom<DataT, PickKeys> | DefaultT, ErrorT | null>
|
||||||
export function useLazyFetch<
|
export function useLazyFetch<
|
||||||
ResT = void,
|
ResT = void,
|
||||||
@ -147,12 +147,12 @@ export function useLazyFetch<
|
|||||||
DefaultT = null,
|
DefaultT = null,
|
||||||
> (
|
> (
|
||||||
request: Ref<ReqT> | ReqT | (() => ReqT),
|
request: Ref<ReqT> | ReqT | (() => ReqT),
|
||||||
arg1?: string | Omit<UseFetchOptions<_ResT, DataT, PickKeys, DefaultT, Method>, 'lazy'>,
|
arg1?: string | Omit<UseFetchOptions<_ResT, DataT, PickKeys, DefaultT, ReqT, Method>, 'lazy'>,
|
||||||
arg2?: string
|
arg2?: string
|
||||||
) {
|
) {
|
||||||
const [opts, autoKey] = typeof arg1 === 'string' ? [{}, arg1] : [arg1, arg2]
|
const [opts, autoKey] = typeof arg1 === 'string' ? [{}, arg1] : [arg1, arg2]
|
||||||
|
|
||||||
return useFetch<ResT, ErrorT, ReqT, DefaultT, _ResT, PickKeys>(request, {
|
return useFetch<ResT, ErrorT, ReqT, Method, _ResT, DataT, PickKeys, DefaultT>(request, {
|
||||||
...opts,
|
...opts,
|
||||||
lazy: true
|
lazy: true
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user