Skip to content
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

Invalid type for children of nested route when overiding path #189

Closed
finlayacourt opened this issue Jun 23, 2023 · 1 comment
Closed

Invalid type for children of nested route when overiding path #189

finlayacourt opened this issue Jun 23, 2023 · 1 comment

Comments

@finlayacourt
Copy link

Reproduction: https://codesandbox.io/p/github/finlayacourt/unplugin-vue-router-issue/master

Consider,

src/pages/
├── parent/
│   └── child.vue
└── parent.vue

with custom path in parent.vue

<route lang="json">
{
    "path": "/"
}
</route>

The generated type for child.vue is

export interface RouteNamedMap {
  '/parent/child': RouteRecordInfo<
    '/parent/child',
    '/parent/child', // !!!
    Record<never, never>,
    Record<never, never>
  >,
}

but should be

export interface RouteNamedMap {
  '/parent/child': RouteRecordInfo<
    '/parent/child', 
    '/child', // !!!
    Record<never, never>,
    Record<never, never>
  >,
}
@posva posva added the bug label Jun 23, 2023
@posva posva closed this as completed in f651961 Jun 23, 2023
@posva
Copy link
Owner

posva commented Jun 23, 2023

Thanks! I have a few other changes pending before releasing but this should hopefully not take too long

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants