AlexLavoie42 / Nuxt-Mapbox

Elegant Mapbox integration with Nuxt
87 stars 11 forks source link

onMounted lifecycle Hook is broken by the library #116

Closed mrc-bsllt closed 3 months ago

mrc-bsllt commented 3 months ago

When nuxt-mapbox is not included within the modules in the nuxt.config.ts file, everything works normally, the onMounted hook is triggered every time I land on the page (or when a component is mounted). But, when I include it in the modules, the onMounted hook is only triggered the first time (it almost seems to be cached).

Reproduction link: https://stackblitz.com/edit/nuxt-starter-csufwc?file=app.vue,pages%2Findex.vue,nuxt.config.ts

AlexLavoie42 commented 3 months ago

See #115

mrc-bsllt commented 3 months ago

See #115

I do not know whether it is a good choice to keep the persistence option at true. Btw, thanks for the answer, fixed it.

AlexLavoie42 commented 3 months ago

Ya it's something I considered turning off, but for most people starting out I think having the map instance not reset on route changes is better.

https://github.com/AlexLavoie42/Nuxt-Mapbox/discussions/107