Allow nuxt-child routes that are NOT the same name as the parent

connecteev
0
connecteev
commented 7 months ago

What problem does this feature solve?

Is it possible to have nuxt-child routes that are NOT the same name as the parent? They all look 99% the same, save for a small section of content.
I want my home page / to be the parent
And:
/top/week
/top/month
/top/year
to all inherit from and be children of the home page. I believe that the current naming convention would not allow setting these up as children of the homepage. Is there a way around this?

What does the proposed changes look like?

Allow nuxt-child routes that are NOT the same name as the parent

idea
0
pimlie
761
pimlie
commented 7 months ago

Yes, use extendRoutes

The use of a naming convention like Nuxt.js does for creating routes is designed to easily work in 95+% of all cases. Your requirement is unfortunately not included in that number ;)

0
connecteev
0
connecteev
commented 7 months ago

@pimlie thanks for clarifying…turns out you dont need an extendRoutes config for this.
I just created an index.vue file and an index/top/_slug.vue and everything works fine!

0
pimlie
761
pimlie
commented 7 months ago

Interesting, didnt expect that to work because of the extra top level.

0
Informations
Feature RequestOpen
#c9778 - Created 7 months ago