diff --git a/packages/hooks/src/useRequest/src/useRequestImplement.ts b/packages/hooks/src/useRequest/src/useRequestImplement.ts index e8bcfe45ae..d65cfba6cb 100644 --- a/packages/hooks/src/useRequest/src/useRequestImplement.ts +++ b/packages/hooks/src/useRequest/src/useRequestImplement.ts @@ -14,7 +14,7 @@ function useRequestImplement( options: Options = {}, plugins: Plugin[] = [], ) { - const { manual = false, ...rest } = options; + const { manual = false, ready = true, ...rest } = options; if (isDev) { if (options.defaultParams && !Array.isArray(options.defaultParams)) { @@ -24,6 +24,7 @@ function useRequestImplement( const fetchOptions = { manual, + ready, ...rest, }; @@ -46,7 +47,7 @@ function useRequestImplement( fetchInstance.pluginImpls = plugins.map((p) => p(fetchInstance, fetchOptions)); useMount(() => { - if (!manual) { + if (!manual && ready) { // useCachePlugin can set fetchInstance.state.params from cache when init const params = fetchInstance.state.params || options.defaultParams || []; // @ts-ignore