We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
如果一个地方的加载跟两个 连续request有关, request1 成功后立刻发起request2. 由于request2 的防抖 导致 request2的loading有延迟, 导致两个loading 不连续。
debounce 等待过程中能否把loading先设置为true 或者有另一个值来表示(比如preLoading)。
<div v-if="loading1 || loading2">loading...</div> <div v-else>content</div>
const { loading: loading2, run } = useRequest(server2); const { loading: loading1 } = useRequest(server1, { manual: false, onSuccess(res) { run(res); }, });
页面会经过会loading... => content => loading... => content。 虽然 debounceOptions: {leading: true} 可以解决问题, 但实际场景中 这与防抖的初衷不相符
The text was updated successfully, but these errors were encountered:
感觉有必要, 现在我的解决方法是在执行 run() 前手动执行 loading.value = true
Sorry, something went wrong.
No branches or pull requests
需求描述 Feature Description
如果一个地方的加载跟两个 连续request有关, request1 成功后立刻发起request2.
由于request2 的防抖 导致 request2的loading有延迟, 导致两个loading 不连续。
建议的解决方案 Proposed Solution
debounce 等待过程中能否把loading先设置为true 或者有另一个值来表示(比如preLoading)。
其他信息 Other information
页面会经过会loading... => content => loading... => content。
虽然 debounceOptions: {leading: true} 可以解决问题, 但实际场景中 这与防抖的初衷不相符
The text was updated successfully, but these errors were encountered: