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

type ignoring folder with bracket #20

Closed
hi-reeve opened this issue Jul 5, 2022 · 6 comments
Closed

type ignoring folder with bracket #20

hi-reeve opened this issue Jul 5, 2022 · 6 comments

Comments

@hi-reeve
Copy link
Contributor

hi-reeve commented Jul 5, 2022

so i have a dynamic route on a folder name [path] is a folder and not a vue file. using useRoute with the route name does not infering the route type, it is ignoring the path if it is a folder

here is the code.
image

here is how the folder structure
image

@posva
Copy link
Owner

posva commented Jul 5, 2022

You are forcing the type of route but you shouldn't do that. Let useRoute('routeName') give you the name. I tried and it works.

Note that if you only have a folder [path], it won't create a name for the route unless there is a [path].vue file alongside it (like with Nuxt).

@hi-reeve
Copy link
Contributor Author

hi-reeve commented Jul 5, 2022

You are forcing the type of route but you shouldn't do that. Let useRoute('routeName') give you the name. I tried and it works.

sorry i dont get what you mean with im forcing the type of route.

Note that if you only have a folder [path], it won't create a name for the route unless there is a [path].vue file alongside it (like with Nuxt).

im naming the detail.vue file name not the [path] folder name? am i missing something here?

@posva
Copy link
Owner

posva commented Jul 5, 2022

Remove the : RouteLocation Ah, that's just visual.

This works when I tested. Can you reproduce it in the repository?

@hi-reeve
Copy link
Contributor Author

hi-reeve commented Jul 5, 2022

Remove the : RouteLocation Ah, that's just visual.

This works when I tested. Can you reproduce it in the repository?

here the repro
https://github.com/zynth17/unplugin-vue-router-bug-dynamic-path

edit: this repro also have the same problem with no autocompletion on generic using useRoute on #12

@posva
Copy link
Owner

posva commented Jul 6, 2022

Thanks, now I see the bug!

@posva posva added the bug label Jul 6, 2022
@hi-reeve
Copy link
Contributor Author

hi-reeve commented Jul 6, 2022

Thanks, now I see the bug!

no problem!

@posva posva closed this as completed in ef078b0 Jul 6, 2022
posva added a commit that referenced this issue Feb 14, 2023
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