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

Do not delete name of route with children #116

Closed
bartlomieju opened this issue Aug 16, 2018 · 10 comments
Closed

Do not delete name of route with children #116

bartlomieju opened this issue Aug 16, 2018 · 10 comments

Comments

@bartlomieju
Copy link

bartlomieju commented Aug 16, 2018

Hi!

Today I stumbled across a problem that deletes name of routes that have children. I think this is unexpected behaviour, as I tend to have directory structure like this:
zrzut ekranu 2018-08-16 o 18 00 38
and do a redirect in vendors/_slug.vue file.

The culprit is this line:
https://github.com/nuxt-community/nuxt-i18n/blob/45ff90d1b8076c12f5c1a75fb7e2d398450e7c51/src/helpers/routes.js#L70

What is your opinion on this one?

This question is available on Nuxt community (#c121)
@ghost ghost closed this as completed Aug 16, 2018
@ghost ghost added the cmty:question label Aug 16, 2018
@ghost
Copy link

ghost commented Aug 16, 2018

This issue as been imported as question since it does not respect nuxt-i18n issue template. Only bug reports and feature requests stays open to reduce maintainers workload.
If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically.
Your question is available at https://cmty.app/nuxt/nuxt-i18n/issues/c121.

@paulgv
Copy link
Collaborator

paulgv commented Aug 16, 2018

Hi @bartlomieju
This change was made to fix a particular issue: #98
I don't remember the details exactly...
Does this prevent you from doing the redirection?

@bartlomieju
Copy link
Author

Hi @paulgv sorry for trouble, it looks like my Nuxt route config is improper, I should have added index.vue file to vendors directory.

@paulgv
Copy link
Collaborator

paulgv commented Aug 17, 2018

@bartlomieju no worries! I was wondering why you didn't have that index.vue actually. All good then!

@ghost
Copy link

ghost commented Aug 17, 2018

This question has been resolved by @bartlomieju, see answer.

@ghost ghost added the cmty:status:resolved label Aug 17, 2018
@berenicestr
Copy link

berenicestr commented Apr 30, 2019

Hi @paulgv and @bartlomieju I have the same error, I open a question: #286

I have the index.vue but it doesn't work for me, it also deletes.

Please, any help to resolve this?

@madmod
Copy link

madmod commented Sep 10, 2019

@paulgv @bartlomieju I think this is breaking a valid use case because the assumption that routes with children should not have a name is incorrect. Navigating to a route which has children is valid and so those routes should be allowed a name.

I have a structure like this which works fine when I remove the deletion.
Screen Shot 2019-09-10 at 2.25.39 PM.png
It is a page with tabs which has children. I need to redirect to the default tab by name for various reasons. This is supported by vue-router and works with nuxt when I disable the vue-i18n plugin.

@rchl
Copy link
Collaborator

rchl commented Sep 12, 2019

I don't immediately see (not sure if I ever knew), why names are removed. Maybe you want to create new issue about that?

But I'm not sure that structure that you've shown is entirely correct. For example, I can't see how to trigger documents.vue at all or even the deeper-level _document.vue.

@madmod
Copy link

madmod commented Sep 12, 2019

@rchl I will create a new issue for it.

The structure works as-is and creates the correct routes. The _folder.vue has tabs with a <nuxt-child> view which shows documents.vue which contains a <nuxt-child> view in a table row detail section which shows _document.vue. It took a while to figure out but now I have nice urls for each state.

@rchl
Copy link
Collaborator

rchl commented Sep 24, 2019

@madmod there is actually already issue about that #356

This issue was closed.
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

5 participants