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

Silence default child warning when redirecting #1442

Merged
merged 2 commits into from Jun 16, 2017

Conversation

decademoon
Copy link
Contributor

There is no need to warn about a named route that has a default child route if the named route intentionally redirects.

There is no need to warn about a named route that has a default child
route if the named route intentionally redirects.
@posva
Copy link
Member

posva commented May 20, 2017

Hey, thanks for the contribution. Could you add a unit test on the create-map.spec.js file, please?

@decademoon decademoon force-pushed the fix-default-child-route-warn branch from 489a77c to 05ba35c Compare May 20, 2017 10:27
Copy link
Member

@posva posva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity, do you use this to redirect to a different child in your app?

@decademoon
Copy link
Contributor Author

No, my setup is pretty much like this:

{
  path: 'foo',
  name: 'foo',
  redirect: { name: 'foo-index' },
  component: require('components/foo/master.vue'),
  children: [
    {
      path: '',
      name: 'foo-index',
      component: require('components/foo/index.vue'),
    },
    {
      path: ':fooId',
      name: 'foo-show',
      component: require('components/foo/show.vue'),
    },
    // etc...
  ],
},

And I write links like this:

<router-link :to="{ name: 'foo' }">Foo</router-link>

@yyx990803 yyx990803 merged commit fb050b0 into vuejs:dev Jun 16, 2017
@decademoon decademoon deleted the fix-default-child-route-warn branch June 17, 2017 06:12
@tebs1200
Copy link

@posva, I do use a redirect to go to a specific child route. I have a route like user/:id which I redirect to one of the nested routes user/:id/feed.

@posva
Copy link
Member

posva commented Aug 11, 2017

@tebs1200 ok, thanks for letting me know 🙂

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

Successfully merging this pull request may close these issues.

None yet

4 participants