N
Nuxt12mo ago
muttley

Examples/Routing/Pages difference static vs reload

I'm noob and still learning...sorry for the trivial question. In the official example: https://nuxt.com/docs/examples/routing/pages I don't understand what difference should be between the parent/reload-[id] and parent/static-[id] pages. I thought the presence of key:
definePageMeta({
key: 'static',
});
definePageMeta({
key: 'static',
});
in the static-[id] page, should prevent the re-rendering as described in Child Route Keys. Avoiding the increment of the reloads var, and the onMounted() execution. So, what is the behavioral difference between the two routes: parent/reload-[id] and parent/static-[id]? And the meaning of key in the definePageMeta() arg? Thanks!
Nuxt
Pages · Nuxt Examples
This example shows how to use the pages/ directory to create application routes.
4 Replies
muttley
muttleyOP11mo ago
GitHub
Difference between static and reload (in Routing/Pages)? · Issue #7...
In the routing/pages example, what should be the difference between the parent/reload-[id] and parent/static-[id] pages? In the parent/static-[id] page code are added these lines: definePageMeta({ ...
pyplacca
pyplacca11mo ago
so parent/static-[id] works as both a static and dynamic page
muttley
muttleyOP11mo ago
I think it avoids re-rendering when you come from a route with the same key
pyplacca
pyplacca11mo ago
I see

Did you find this page helpful?