Replies: 2 comments
|
I just noticed I was missing |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I am having some issues getting the "scope" of a nested route to update when the URL of the route changes when using the
$urlhelper.Pre-requisite:
My current

Pagesstructure is setup like this:So the general idea I am going for, is that I have a set of "Categories" which each contain a set of "Types". When viewing
/[category]route, the idea is that all of thetypeswould be represented astabs. When you click on a "Type" tab, you would then be presented with a number of entries for that combination of "Category" and "Type". You could then freely switch between tabs within the category to see all of the different entries.Here is my
_layout.sveltefor [category]In
npm run devnavigating to the/beefroute generates the list oftypesas expected. And manually updating the URL also works as expectedUpon clicking one of the
types, the URL updates, and I also get the expected display of my nested route.Here is my
_layout.sveltefor the [category]/[type] routeAnd here is the
index.jsThe tabs remain on the page (as expected) and everything seems to be ok - However, if I click on a different
type, the URL updates, but my "scope" does not update, and therefore, thetypevalue in myindex.jsdoes not reflect the updated value. Only upon refresh of the browser to I see the updatedtypevalue I expect.I hope this makes sense, and I am sure I am missing something very minor! Any help would be appreciated!
All reactions