This repository was archived by the owner on Feb 24, 2026. It is now read-only.
Same component for multiple routes #328
Unanswered
fedee13
asked this question in
Questions and Help
Replies: 1 comment
-
|
Why should we exclude component in definePage? I think retaining this field can give users greater freedom interface DefinePage extends Partial<Omit<RouteRecordRaw, 'children' | 'components' | 'component' | 'name'>>In fact, is it only excluded at the type level now? I found that if I write like this, I will only encounter type errors and the function will run normally. definePage({
component: () => import('x.vue'),
}) |
Beta Was this translation helpful? Give feedback.
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.
-
Hi! I want to use the same component in 3 different routes but I can't make the .d.ts file to update accordingly. (kind of related to #129 but I did not find an example for it)
If a create an alias it works, but in typed-router.d.ts only appears the "add" route (the alias are the edit and view) so I don't have a way to programatically call them thorugh the IDE autocomplete, it only gives me the "add" route.
How would I need to use extendRoutes so that I have the 3 routes as separate routes?
This is what I'm doing:
This is what I'm trying to do:
Beta Was this translation helpful? Give feedback.
All reactions