hooks icon indicating copy to clipboard operation
hooks copied to clipboard

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

Open Siykt opened this issue 2 years ago • 3 comments

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

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

image

Siykt avatar Nov 30 '23 08:11 Siykt

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

Atw-Lee avatar Dec 01 '23 08:12 Atw-Lee

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

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

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

Siykt avatar Dec 02 '23 03:12 Siykt

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

afishhhhh avatar Dec 06 '23 06:12 afishhhhh