Merge pull request #276 from dwyanewang/main

fix(useRequest): 修复立即执行时参数类型不匹配的问题
This commit is contained in:
菲鸽
2025-09-19 15:16:25 +08:00
committed by GitHub

View File

@@ -48,7 +48,7 @@ export default function useRequest<T, P = undefined>(
}
if (options.immediate) {
(run as (args: P) => Promise<T | undefined>)({} as P)
(run as (args?: P) => Promise<T | undefined>)({} as P)
}
return { loading, error, data, run }
}