Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useRequest loading 的初始值为 false #2459

Closed
alindas opened this issue Jan 30, 2024 · 2 comments
Closed

useRequest loading 的初始值为 false #2459

alindas opened this issue Jan 30, 2024 · 2 comments

Comments

@alindas
Copy link

alindas commented Jan 30, 2024

如题,useRequest loading 的初始值为 false,如果我需要他的初始值为 true,可以怎么调整;

需求场景:组件使用 useRequest 请求 onMount 数据,配合 Spin 设置加载动效,我希望组件刚挂载进去就能触发 Spin,从而排除其他因素导致的页面抖动效果;

-----en------
As the question suggests, the initial value of useRequest loading is false. If I need its initial value to be true, how can I adjust it;

Requirement scenario: The component uses useRequest to request onMount data, and in conjunction with Spin settings to load dynamic effects, I hope that the component can trigger Spin as soon as it is mounted, thereby eliminating page jitter effects caused by other factors;

@q269384828
Copy link

外面加一个状态呗

@crazylxr
Copy link
Collaborator

crazylxr commented Feb 26, 2024

楼上正解,自己用一个 loading 状态来控制,不采用 useRequest 的 loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants