Aleksandar Brkić
Prevent rerendering of page going back
I have a structure like this
with the [post-author].vue acting like a modal inside of list that has a <NuxtPage /> inside it. I added a
key
inside of definePageMeta
in the list.vue file
When i scroll through it and enter a single post and go back, it remains intact and works perfectly without rerendering. However, if I visit some filters and then enter the post and go back, the filters re-render as the post is not a child of filters but of list.
Is there any way to prevent rerendering /list children whilst navigating from list/single-123/[post-author] to list/filter1/filter2 ?1 replies
Unknown order of nested routes
So i have a couple of thoughts on how to do this, but neither of them seems optimal.
tldr; When someone goes to
/time-7-15/latitude-40-50/
the page should render a list of all objects that have values in that range.
I need to have nested routes, let's call them filters. The filters are time, latitude and longitude. Each filter is based on ranges, so time can be 7-15 or 15-23 and latitude can be 40-50 or 50-60 (similar for longitude).
So examples of routes:
/time-7-15
or
/time-7-15/latitude-40-50
or
/latitude-40-50
or
/latitude-50-60/longitude-20-30
or
/time-15-23/latitude-40-50/longitude-20-30
etc etc, so by either one of the filters, but also you can omit some and have the other.
Based on the route, i need to have the resulting rendered list. I was thinking to have a shared layout and in the filters checkbox component have a v-if based on the route params but...
Because the order is not always the same (for instance you can have time and lat, or just lat without the time) i cannot do it like
because lat is not nested in time (but can be). What is the correct way of dealing with these types of nested routes?7 replies
Dynamic nested pages
Is there a way to have a route structure where there is an unknown amount of slugs eg:
So that the filters will always affect the list, eg clicking on a filter will add a slug but not rerender the page, just the list component?
Tried with
index
folder that has [...slug].vue
but not sure how to have single-post after that regardless of the number of slugs?9 replies