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

NuxtPage redirect type is wrong for pages extend hook #21706

Closed
silencerspirit opened this issue Jun 22, 2023 · 0 comments · Fixed by #21713
Closed

NuxtPage redirect type is wrong for pages extend hook #21706

silencerspirit opened this issue Jun 22, 2023 · 0 comments · Fixed by #21713

Comments

@silencerspirit
Copy link
Contributor

Environment

Reproduction

https://stackblitz.com/edit/github-yb5amz?file=nuxt.config.ts

Describe the bug

When extend pages got type error for NuxtPage type

type NuxtPage = {
    name?: string;
    path: string;
    file?: string;
    meta?: Record<string, any>;
    alias?: string[] | string;
    redirect?: string;
    children?: NuxtPage[];
};

Must be

import type { RouteRecordRedirectOption } from 'vue-router'

type NuxtPage = {
    name?: string;
    path: string;
    file?: string;
    meta?: Record<string, any>;
    alias?: string[] | string;
    redirect?: RouteRecordRedirectOption; // or another redirect type
    children?: NuxtPage[];
};

Additional context

Can I create a pull request for this?

or tell me how it can be fixed more correctly :)

Logs

No response

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

Successfully merging a pull request may close this issue.

1 participant