Multiple dynamic routes on the same level in Nuxt possible?

Viewed 1360

Is it possible to have multiple dynamic routes on the same level in NuxtJS?

I tried this but it doesn't work:

pages
--_article.vue
--_city.vue

I'm using Nuxt Content and wanted to load different content dynamically with unique layout/design on the same page level.

1 Answers

You can simply create two different routes for city and article and under them you can dynamically generate routes. For example, your pages folder should look like this:

---| article
-----| _slug.vue
---| city
-----| _slug.vue

With this you can achieve routes like:

/city/:city_id
/article/:article_id

Related