Relative Content

Tag Archive for javascriptvue.jsvuejs3nuxt.jsnuxt3.js

VueUse useIntersectionObserver causes initial flash before transition

I’m using useIntersectionObserver from VueUse to apply a fade-in transition on elements when they come into view. However, on initial page load, the elements briefly appear before the intersection observer triggers, causing a flash and applying the fade-in effect with a delay.

Intersection observer not triggering on page load and route back

I use useIntersectionObserver from VueUse to trigger a fade-in animation when an element enters the viewport. If I navigate to another page (e.g., click on an item in the carousel to view its details) and then go back to previous route with the saved position, the intersection observer doesn’t trigger automatically, and the elements remain hidden unless I scroll the page down and up or refresh it. Also, if I scroll to the carousel, click on the carousel item and navigate to another route, the observer fails to trigger sometimes as well. So it’s not only an issue when returning to a route, but also after scrolling and navigating to another route.

SSR shows signedIn state as false after page reload despite existing session cookie

The signedIn state is shown as false on the server-side after a page reload, even though the session cookie exists and the client correctly shows it as true. When I first sign in, I can see the cookie is added in the browser, and also I see it in the terminal and signedIn is set to true. After I reload the page, I still can see the cookie in both terminal and the browser, but now I also see:
*ssr* signedIn: false
signedIn: true

SSR shows signedIn state as false after page reload despite existing session cookie

The signedIn state is shown as false on the server-side after a page reload, even though the session cookie exists and the client correctly shows it as true. When I first sign in, I can see the cookie is added in the browser, and also I see it in the terminal and signedIn is set to true. After I reload the page, I still can see the cookie in both terminal and the browser, but now I also see:
*ssr* signedIn: false
signedIn: true

Issues with useRoute in middleware

When using a composable which uses useRoute inside middleware I receive this warn: ‘[nuxt] Calling useRoute within middleware may lead to misleading results. Instead, use the (to, from) arguments passed to the middleware to access the new and old routes.’

UI elements jitter when being conditionally rendered

I’m have an issue where buttons and links jitter on state change (when clicking on the “Sign Out” button). I tried both v-if and v-show and the jitter persists.
Video of the issue: https://www.veed.io/view/89672f51-f55c-411c-883f-440b02cfa4de?panel=share
Reproduction: https://stackblitz.com/edit/nuxt-starter-a8hntf?file=app%2Fcomposables%2FuseStoreAuth.ts.

UI elements jitter when being conditionally rendered

I’m have an issue where buttons and links jitter on state change (when clicking on the “Sign Out” button). I tried both v-if and v-show and the jitter persists.
Video of the issue: https://www.veed.io/view/89672f51-f55c-411c-883f-440b02cfa4de?panel=share
Reproduction: https://stackblitz.com/edit/nuxt-starter-a8hntf?file=app%2Fcomposables%2FuseStoreAuth.ts.

UI elements jitter when being conditionally rendered

I’m have an issue where buttons and links jitter on state change (when clicking on the “Sign Out” button). I tried both v-if and v-show and the jitter persists.
Video of the issue: https://www.veed.io/view/89672f51-f55c-411c-883f-440b02cfa4de?panel=share
Reproduction: https://stackblitz.com/edit/nuxt-starter-a8hntf?file=app%2Fcomposables%2FuseStoreAuth.ts.

UI elements jitter when being conditionally rendered

I’m have an issue where buttons and links jitter on state change (when clicking on the “Sign Out” button). I tried both v-if and v-show and the jitter persists.
Video of the issue: https://www.veed.io/view/89672f51-f55c-411c-883f-440b02cfa4de?panel=share
Reproduction: https://stackblitz.com/edit/nuxt-starter-a8hntf?file=app%2Fcomposables%2FuseStoreAuth.ts.

Persist dark mode in Nuxt 3

I use useDark from VueUse to implement the dark mode. When I go to another route the dark mode doesn’t persist, possibly due to SSR, since the server doesn’t know about the current mode.