Home

Issue: 2932

Dynamic route without index file

[issue link]

I would like to have the following URL
/recipes/:slug
to show a page with a recipe.

However, I don’t want a page under URL /recipes.

If I understand the docs correctly this is not possible? If I create the folder structure (in pages/)
/recipes
________/_slug
________________/index.vue
=> the slug becomes optional and visiting /recipes would also render the index.vue but without a slug.

If I have the structure
/recipes
________/_slug
________________/index.vue
________/index.vue
=> the slug becomes required, but now I get a URL /recipes for which I don’t want a page.

Question: is this possible using the automated route generation in Nuxt or should I create my router file myself?

This question is available on Nuxt.js community (#c2547)