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

设置 loadingDelay 后, loading 初始值应当为 false #2382

Open
Siykt opened this issue Nov 30, 2023 · 3 comments · May be fixed by #2394
Open

设置 loadingDelay 后, loading 初始值应当为 false #2382

Siykt opened this issue Nov 30, 2023 · 3 comments · May be fixed by #2394

Comments

@Siykt
Copy link

Siykt commented Nov 30, 2023

在我理解的里, 只要传入的callback执行用时小于 loadingDelay, loading就不应该发生变化, 那么初始值更不应该为 true

See https://codesandbox.io/p/sandbox/shy-feather-5q3ffx?file=%2Fsrc%2Findex.js

image

@Atw-Lee
Copy link

Atw-Lee commented Dec 1, 2023

实际业务中没法判断你的执行用时是多少。
初始值如果想是false,可以把manual打开。

@Siykt
Copy link
Author

Siykt commented Dec 2, 2023

@Atw-Lee 初始值为true怎么防止闪烁?

通过设置 options.loadingDelay ,可以延迟 loading 变成 true 的时间,有效防止闪烁。

而且为什么需要判断callback的执行用时? 要检查的不是 options.loadingDelay 是否大于0么?

@afishhhhh
Copy link

emmm....我也很迷惑 怎么初始值是 true

Siykt added a commit to Siykt/hooks that referenced this issue Dec 8, 2023
@Siykt Siykt linked a pull request Dec 8, 2023 that will close this issue
18 tasks
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

Successfully merging a pull request may close this issue.

3 participants