vuejs / router

🚦 The official router for Vue.js
https://router.vuejs.org/
MIT License
3.86k stars 1.18k forks source link

Nested Routers #1089

Open posva opened 3 years ago

posva commented 3 years ago

What problem does this feature solve?

Allow using nested memory routers to handle independent views. e.g. the messages on Twitter, or a chat.

A custom History implementation could even save the current page in local storage and restore it when reopening the app.

What does the proposed API look like?

provideRouter(createRouter(...))
// or
createNestedRouter(baseRouterOptions)
posva commented 3 years ago

This would have to go through an RFC to better identify the different needs of creation/destruction of nested routers.

Bertie2011 commented 5 months ago

The use case I have is having independent movable windows in an app with their own navigations. I also could imagine this being useful for plenty of gamified apps (e.g. a shop/menu sidebar that has multiple levels to it)

brendomaciel commented 5 months ago

It's a pretty nice feature. It would address this scenario I guess.

kissu commented 1 month ago

Could also be useful in the use case of some micro-frontends where there are a lot of moving parts and people want to have it fully dynamic. Having 2 nested routers doesn't work so well right now.

PS: the current state of this issue is the following:

Got this info from posva himself on the Discord server.