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

@4.3.3 the redirect / to home is not effective when children get /:pathMatch(.*) #2268

Closed
sherleysong opened this issue Jun 11, 2024 · 2 comments

Comments

@sherleysong
Copy link

Reproduction

https://jsfiddle.net/5qv469nr/2/

Steps to reproduce the bug

{ path: '/', redirect: '/foo' },
{ path: '/foo', component: Foo },
{
path: '/:pathMatch(.*)',
component: Bar
}

Expected behavior

goto foo

Actual behavior

goto bar

Additional information

{ path: '/', redirect: '/foo' }, // when come to "/" , I hope go to foo page which is my actural home page { path: '/foo', component: Foo }, { path: '/:pathMatch(.*)', // when not "/ " or not "foo", I hope go to bar page , which is my 404 page . component: Bar }

the actural code is like this :

{ path: '/', name: 'home', component: Main, redirect: '/home', meta: { title: '首页' }, children: [ { path: '/home', name: 'home', meta: { title: '首页' }, component: () => import('src/components/home') }, { path: '/:pathMatch(.*)', component: () => import('src/components/error-page/404.vue') } ] }

the code before [email protected] is OK , but wrong when come to [email protected] .

can you fix it @4.3.4 ?

@sherleysong sherleysong changed the title @4.3.3 the redirect / to home is not effective when sub @4.3.3 the redirect / to home is not effective when children get /:pathMatch(.*) Jun 11, 2024
@posva
Copy link
Member

posva commented Jun 11, 2024

Duplicate of #2266

@posva posva marked this as a duplicate of #2266 Jun 11, 2024
@posva posva closed this as not planned Won't fix, can't repro, duplicate, stale Jun 11, 2024
@posva
Copy link
Member

posva commented Jun 11, 2024

You have duplicated names, remove the one you don't want

@vuejs vuejs locked and limited conversation to collaborators Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants