drunomics / nuxtjs-drupal-ce

A Nuxt module to easily connect Drupal via custom elements.
https://lupus-decoupled.org/
MIT License
22 stars 4 forks source link

Ensure menu data is re-used across requests #128

Closed fago closed 1 year ago

fago commented 1 year ago

After first-page load, the menu data is available, e.g. due to state-hydration. When navigating around pages, the menu data should not be re-fetched (unless language changes later on)

TurtlBbx commented 1 year ago

Cache support for useFetch/useAsyncData is not supported internally/out-of-the-box in Nuxt at the moment, as you can see in this open issue: https://github.com/nuxt/nuxt/issues/15445.

Solutions:

fago commented 1 year ago

@TurtlBbx what about keepalive? https://vuejs.org/guide/built-ins/keep-alive.html

fago commented 1 year ago

@TurtlBbx this is actually fixed by having the component in the layout https://github.com/drunomics/lupus-decoupled-nuxt3-demo/commit/f54c44808a1858d5aeaf669acca2290063db1eba

moving breadcrumbs in the layout breaks things though, a new bug.