Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
posva opened this issue Feb 25, 2025 · 0 comments
Open

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

posva opened this issue Feb 25, 2025 · 0 comments
Labels
🐞 bug this isn't working as expected

Comments

@posva
Copy link
Owner

posva commented Feb 25, 2025

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 }
        ]
      }
    ]
  }
]
@posva posva added the 🐞 bug this isn't working as expected label Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug this isn't working as expected
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant