Dynamic nested pages

Is there a way to have a route structure where there is an unknown amount of slugs eg:
example 1:
site. com/filterX/filterY/list
site. com/filterX/filterY/list/single-post

example 2:
site. com/filterY/list
site. com/filterY/list/single-post
example 1:
site. com/filterX/filterY/list
site. com/filterX/filterY/list/single-post

example 2:
site. com/filterY/list
site. com/filterY/list/single-post
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?
7 Replies
pyplacca
pyplacca6mo ago
Do /filterX/filterY/list and /filterY/list display filtered results from the same source?
Aleksandar Brkić
/list has a list component that filters the array from pinia based on the route params eg filterX and filterY
pyplacca
pyplacca6mo ago
Would query parameters not suffice? Eg; /list?filterX=x&filterY=y…
Aleksandar Brkić
No, unfortunately. There wouldn't be a problem with that 😄
pyplacca
pyplacca6mo ago
Unless /filterX/list and /filterX/filterY/list although similar have very distinct features Are you trying to take a different approach?
Aleksandar Brkić
the approach is defined in the post title.
pyplacca
pyplacca6mo ago
Yhh I read it. Just not sure why, but maybe someone else can help you out 👍
Want results from more Discord servers?
Add your server