-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support children structures that have no route component (and only children) #78
Comments
I'm also facing this and can't use typed routes 😞 @JohnCampionJr Have you checked unplugin-vue-router, that's future 🚀 |
I believe you can use "." to replace "/". |
This would defeat the main purpose of unplugin-vue-router, if everything used ".", which means no longer using folder structures for routing paths. |
vue-router supports nested routes as documented here. However, one item not described in the documentation is a newer feature, which allows users to not provide a
component
whenchildren
has contents. What this can mean is you can have something like the following:Where parent routes may only have
children
and nocomponent
, which means it's just an alternative way of structuring the route list. Under this scenario, vite-plugin-vue-layouts should probably traverse the routes, and if it encounters a route withchildren
but nocomponent
, it recurses into those sub-routes, all the way through the tree.This has come up for me recently, when using the unplugin-vue-router package, which generates it's routes in a non-flat fashion (compared to vite-plugin-pages), and this is still valid for vue-router. see this issue for discussion on the topic.
In the above issue, I have a temporary solution that allows this workflow by recursively re-invoking
vite-plugin-vue-layouts
, though it's not pretty:It would be nice if vite-plugin-vue-layouts could support the
children
functionality.The text was updated successfully, but these errors were encountered: