Muhammad Mahmoud
Reactivity with UseFetch
You posted your custom
$fetch
and useFetch
implementations. A snippet of using those in the Filters
component could help more. But as I currently understand your question, you can create a computed variable (for example, refinedFilterOptions
) that removes the empty values filterOptions
and any other logic you want and pass that to the useApi
composable. Whenver the value of refinedFilterOptions
changes it will trigger re-fetching because its reactive.7 replies
vue-smooth-scroll on nuxt3?
I made a stackblitz playground and it works. Check it maybe you missed something?
https://stackblitz.com/edit/nuxt-starter-qeq8it?file=app.vue
7 replies
Test Utils + Vitest + MSW - potential caching issue
Maybe unrelated a bit but isn't msw doesn't work correctly with nuxt (specificaly ofetch)?
https://github.com/nuxt/nuxt/discussions/24519
https://github.com/unjs/ofetch/issues/295
4 replies
Partytown with Vercel Analystics & Vercel Speed Insights
Partytown is used with external scripts only (Which you load by adding a script tag). Vercel analytics is an npm package and not an external script. A workaround (Haven't tried this before so not sure) would be uploading vercel analytics to some cdn and import that script with a script tag and add
type='text/partytown'
5 replies
access to something everywhere in the project
That's global state you want. You can do that by using
useState
in a composable like this for example
Then use it anywhere in the app
I find useState
is enough for me but you can also see Pinia
for more complex state managment5 replies
Fetch Data even on page reload using custom Fetch Composable
You see no requests on reload (or first load for that matter) because the requests are made server side not on the client. Try to log anything in your console.log and you'll see it in the dev server terminal. For the errors you can destruct
error
from your custom useFetch just like you're destrctring data
and pending
9 replies