[useAsyncData] Component is already mounted, please use $fetch instead. See
Why do I have component already mounted?
I want to use useAsyncData, to get the status to see if it is pending or success to render a loading state, how can I?
I've use useAsyncData in my composables that I directly call in my setup, do I have to make my own loading and use $fetch directly since useAsyncData needs to be call in the setup?
Thanks!
2 Replies
usually composables are meant to be used inside other composables or directly in scrip setup
u can either use remove it outisde the
handleComplete
function, add { immediate: false }
as a second argument to it, the u can call the execute
command.
then u manually call execute
or simply remove use $fetch
directly like warning suggests
thanks @Cake