-
Notifications
You must be signed in to change notification settings - Fork 64
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
unable to work with unplugin-vue-router/vite
#129
Comments
unplugin-vue-router/vite
Nothings jumping out at me. Can you provide a repro or compare to Vitesse? https://github.com/antfu/vitesse/blob/main/src/main.ts |
Hello,
And I'm passing this router to Vue with |
@mathieu-gilloots You need to create router in this way: import { createRouter } from 'vue-router/auto'
import { setupLayouts } from 'virtual:generated-layouts'
const router = createRouter({
// ...
extendRoutes: (routes) => setupLayouts(routes),
}) |
Added this to README |
Hello @JohnCampionJr & @hihanley Thanks |
Not sure if anything changed but this is my working config with import { setupLayouts } from 'virtual:generated-layouts';
import { createRouter, createWebHistory } from 'vue-router';
import { routes } from 'vue-router/auto-routes';
const router = createRouter({
history: createWebHistory(),
routes: setupLayouts(routes),
});
|
Hello,
I think I'm missing something.
When I create a router, I use the setupLayouts() method.
In the output of the method, I get the right layout with the page as a children.
When I output the router.getRoutes(), I didn't get the layout and children only the page.
My code :
Output :
Versions used :
Any ideas ?
Thanks
The text was updated successfully, but these errors were encountered: