#useFetch for post api don't work in onMounted

1 messages · Page 1 of 1 (latest)

river stone
deft dagger
#

My get request is also not working 😕

But $fetch works.

When I use useFetch it don't even send the request 😅

Btw is it legal to use onMounted in nuxt ?? Don't seem to find anything about this lifecycle.

river stone
#

Thanks. My post api also worked when I used $fetch.

#

I want to know why $fetch works, so I looked for the documentation but could not find it...

#

Btw is it legal to use onMounted in nuxt ??
For example, it may need onMounted when I want to execute a save process that is not related to the rendering and don’t block the rendering. However, useLazyFetch instead of $fetch may also work. In my understand, useLazyFetch don’t block the rendering.

vale skiff
#

@river stone instead of doing that in onMounted, why not using the server: false option

river stone