Skip to content

Is it possible to avoid nesting for the index route? #590

Open
@posva

Description

@posva

Discussed in #589

Originally posted by Pentadome February 25, 2025
In the following example, users.create.vue won't be nested in users.vue

src/pages/
├── users/
│   ├── [id].vue
│   └── index.vue
├── users.vue
└── users.create.vue

However, if i try the following:

src/pages/
├── users/
│   └── [id].vue
├── users.vue
└── users.index.vue

users.index.vue will still be nested in users.vue.

I also tried:

src/pages/
├── users/
│   └── [id].vue
├── users.vue
└── UsersHome.vue

with

definePageMeta({
  path: '/users
})

but this didn' work either.

In other words, is it possible to get something like this with file based routing?

routes: [
  {
    path: "/users/:username",
    children: [
      { path: "", component: UserHome },
      {
        path: "",
        component: User,
        children: [
          { path: "profile", component: UserProfile },
          { path: "posts", component: UserPosts }
        ]
      }
    ]
  }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugthis isn't working as expected

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions