Cannot clearError
from useLazyAsyncData
, how to handdle error in useLazyAsyncData
?
#21890
Labels
clearError
from useLazyAsyncData
, how to handdle error in useLazyAsyncData
?
#21890
Environment
Reproduction
https://stackblitz.com/edit/github-vcwesf?file=pages%2Fexample.vue
Describe the bug
Check out the reproduction link.
Step 1: Click
Go to /example
Step 2: Click
Next page
,useLazyAsyncData
will raises an error on the 2nd page, the error screen appears.Step 3: Click
Clear error
, it will redirect to the home page.Step 4: Click
Go to /example
again, and it still showing the error.I'm not sure this is a bug or might be I'm miss understand about handling error.
The docs does't show how to handle error during fetching data with
useLazyAsyncData
anduseAsyncData
, I'm assuming that handling theerror
is similar to thedata
one, like this:Can anyone explain the case and show me the right way to handle the error in
useLazyAsyncData
anduseAsyncData
.I think the docs should add some examples for this too.
Additional context
In the step number 2, if I click the
Tigger Error
button instead ofnext page
, then in the step 4, it will work correctly.Logs
No response
The text was updated successfully, but these errors were encountered: