named index.vue files

mrfrase3
0
mrfrase3
commented 2 months ago

What problem does this feature solve?

It can get a bit confusing/annoying when you have 30 index.vue, or 10 _id.vue files

What does the proposed changes look like?

the ability to add a name to a dynamic file which is ignored.

e.g. index.users.vue _id.classes.vue index.homepage.vue

idea
0
ricardogobbosouza
1.1k
ricardogobbosouza
commented 2 months ago

Hi @mrfrase3
I did not understand the desired feature, could you explain it better?

0
mrfrase3
0
mrfrase3
commented 2 months ago

So in the router for a nuxt application, you use the file names to determine the functionality in the router, (e.g. index.vue and _id.vue) the problem with this is that with a large application, you can easily end up with 30 index.vue files, which can be difficult/annoying for a dev to navigate.

What I'm proposing is that anything defined after a dot on a specially named file is ignored, allowing you to have more meaningful file names. so index.<custom_name>.vue would be the same as index.vue

0
ricardogobbosouza
1.1k
ricardogobbosouza
commented 2 months ago

@mrfrase3 with this module you can register your routes as you prefer.

You may be interested in analyzing this other module https://github.com/nuxt-community/router-extras-module

0
Informations
Feature Request โ€ข Open
#c49 - Created 2 months ago