anonymous-dev
anonymous-dev

Reputation: 3499

How can I specify what the default child route is?

They describe here

https://nuxtjs.org/guide/routing#dynamic-routes

That you can use the _id.vue to be the initial child page. But I would like to have a concrete page as my child page. Is that possible?

So this is working currently

pages/
--| posts/
-----| _id.vue
--| posts.vue

By using

<nuxt-child />

in posts.vue. But I would like this

pages/
--| posts/
-----| post1.vue
--| posts.vue

Where post1 would be my initial child.

Upvotes: 0

Views: 760

Answers (1)

soroush
soroush

Reputation: 756

Your structure should be like this:

pages/
--| posts/
-----| post1.vue
-----| index.vue

index.vue should route like /posts

Upvotes: 1

Related Questions