I added the TreeView in __layout.svelte
, and on:select
I use svelte's goto()
to jump to a path defined for the selected id.
But there are several issues:
- If I pass the url of a sub page on the tree, the left tree can't be selected correctly, it always select the default one.
- Similarly, If I click a link, the left tree can't be selected correctly.
I saw the left tree from document works well.
How is that done?
Questions:
- So, how to change / init the
activeId
properly, when the id is not selected by click items in the tree? - Is there a better way to share the tree among multiple route pages?